我正在尝试建立使用VS代码使用远程容器插件的气流调试环境。我到目前为止所做的:
docker-compose up 10.13.6上使用Desktop社区2.4实现图像apache/airflow:2.2.4airflow-scheduler容器。launch.json文件"version": "0.2.0",
"configurations": [
{
"name": "Airflow Test",
"type": "python",
"request": "launch",
// $ which airflow
"program": "/home/airflow/.local/bin/airflow",
"console": "integratedTerminal",
"args": [
"dags",
"test",
"task_of_middleware",
"2022-04-08"
],
"justMyCode": true
}
]当我开始调试时,VS代码在下面弹出错误:
The terminal process failed to launch: Path to shell executable "/sbin/nologin" does not exist.附加的正在运行的容器显示错误:
[1382 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr "
[1518 ms] Container server: Error: spawn /sbin/nologin ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[1525 ms] Error: spawn /sbin/nologin ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[1530 ms] Container server: (node:11888) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(Use `node --trace-warnings ...` to show where the warning was created)我认为容器运行正常,因为我能够通过Desktop连接到容器外壳并运行气流测试命令。如有任何建议,将不胜感激。
发布于 2022-04-15 02:59:34
不确定这是否是最佳实践,我找到了一种方法来简化错误并使调试器正常运行。通过选择远程容器:打开容器配置文件,在附加后从命令调色板将配置放入附加容器配置文件中。
// Container user VS Code should use when connecting
"remoteUser": "root"https://stackoverflow.com/questions/71855290
复制相似问题