flathub / flathub/com.visualstudio.code

devcontainers using docker-compose can't find Dockerfile

オープン
#549 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
217
フォーク
82
平均マージ
1日 7時間
マージ済み PR(30日)
1

説明

I have a project that has an existing `docker-compose.yml` that I'd like to use. This `docker-compose.yml` runs a service built from a local `Dockerfile`, referenced as follows:

```yaml
build:
dockerfile: "Dockerfile"
context: .
```

My `.devcontainer/devcontainer.json` is as follows:

```json
{
"name": "",
"dockerComposeFile": "../docker-compose.yml",
"service": "",
"workspaceFolder": "/app",
"shutdownAction": "stopCompose"
}
```

Opening VSCode using this seemingly simple setup however fails:

```
[2024-10-18T13:35:07.085Z] Traceback (most recent call last):
File "/usr/bin/podman-compose", line 8, in
[2024-10-18T13:35:07.085Z] sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/podman_compose.py", line 3504, in main
[2024-10-18T13:35:07.086Z] asyncio.run(async_main())
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
[2024-10-18T13:35:07.086Z] return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/podman_compose.py", line 3500, in async_main
[2024-10-18T13:35:07.086Z] await podman_compose.run()
File "/usr/lib/python3.12/site-packages/podman_compose.py", line 1743, in run
[2024-10-18T13:35:07.087Z] retcode = await cmd(self, args)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/podman_compose.py", line 2422, in compose_build
s = await t
^^^^^^^
File "/usr/lib/python3.12/asyncio/tasks.py", line 631, in _wait_for_one
return f.result() # May raise f.exception().
^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/podman_compose.py", line 2373, in build_one
[2024-10-18T13:35:07.087Z] raise OSError("Dockerfile not found in " + ctx)
[2024-10-18T13:35:07.087Z] OSError: Dockerfile not found in /home//
[2024-10-18T13:35:07.115Z] Error: executing /usr/bin/podman-compose --project-name -f /home///docker-compose.yml -f /home//.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1729258506835.yml build: exit status 1
[2024-10-18T13:35:07.123Z] Stop (287 ms): Run: /home//.local/bin/podman-host compose --project-name -f /home///docker-compose.yml -f /home//.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1729258506835.yml build
[2024-10-18T13:35:07.126Z] Error: Command failed: /home//.local/bin/podman-host compose --project-name -f /home///docker-compose.yml -f /home//.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1729258506835.yml build
[2024-10-18T13:35:07.126Z] at Pm (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:430:525)
[2024-10-18T13:35:07.126Z] at async ftA (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:430:2476)
[2024-10-18T13:35:07.126Z] at async htA (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:410:3496)
[2024-10-18T13:35:07.126Z] at async TtA (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:4021)
[2024-10-18T13:35:07.126Z] at async iB (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:4963)
[2024-10-18T13:35:07.126Z] at async wrA (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:663:203)
[2024-10-18T13:35:07.126Z] at async DrA (/home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:662:14830)
[2024-10-18T13:35:07.127Z] at async /home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:1190
[2024-10-18T13:35:07.143Z] Stop (1298 ms): Run: /app/extra/vscode/code /home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home//.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path /home//.local/bin/podman-host --container-session-data-folder /tmp/devcontainers-1248c3b6-2a23-4114-a0b8-e99fac641c2c1729258504414 --workspace-folder /home/ --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/home// --id-label devcontainer.config_file=/home///.devcontainer/devcontainer.json --log-level debug --log-format json --config /home///.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2024-10-18T13:35:07.143Z] Exit code 1
[2024-10-18T13:35:07.151Z] Command failed: /app/extra/vscode/code /home//.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.388.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home//.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path /home//.local/bin/podman-host --container-session-data-folder /tmp/devcontainers-1248c3b6-2a23-4114-a0b8-e99fac641c2c1729258504414 --workspace-folder /home// --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/home// --id-label devcontainer.config_file=/home///.devcontainer/devcontainer.json --log-level debug --log-format json --config /home///.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2024-10-18T13:35:07.151Z] Exit code 1
```

`OSError: Dockerfile not found in /home//` seems weird to me, because the `Dockerfile` _is_ there. Outside of VSCode and Flatpak and what not I can build this Docker (well, Podman really) setup just fine, so I'm guessing the Flatpak sandbox is in the way somehow?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

.devcontainer/devcontainer.json と docker-compose.yml から始め、次にログに記載された Podman/VS Code Flatpak のセットアップを使って失敗を再現します。podman-compose から見えている Dockerfile のパスをプロジェクトの構成と比較し、Flatpak sandbox が関与しているかどうかを判断します。原因と、再現可能な修正または文書化された workaround が確立されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, docker-compose, vscode
領域
devops, devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。