-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Dockerfile to build devcontainer with Podman causes VSCode to hang #9748
Comments
Is this a bug in Podman? You mention |
I'm not sure if this is a bug, I haven't yet filed a bug with Podman. But that's correct, if Testing a bit more locally this also means that
After testing more I updated my original post; manually running the failed Podman command doesn't work, VSCode continues trying to build the container. |
In case any body else happens to run into this, you can use the ~/.local/bin/podman-devcontainers:
~/.config/devcontainers-registries.conf:
And then use @chrmarti, at the very least there should be a way to cancel the container creation process. If the process fails due to an error, VSCode prompts the user what to do. In this case there's no option other than killing VSCode entirely. |
I think devcontainers/cli#746 might have changed it, so we now always pass |
@awesomekyle correct, restricting the number of registries is a workaround mkdir $HOME/.config/containers
cat <<EOF > $HOME/.config/containers/registries.conf
unqualified-search-registries = ['docker.io']
EOF |
@chrmarti podman tag behavior is not as docker but BASE_IMAGE miss localhost/ before it. |
Not sure what the correct fix is here. It's unfortunate that a change on our side broke things, but I also think adding |
That appears to work. We already use Adding the suggested fix, could someone file an issue with Podman to check if the behavior is expected? It seems the addition of |
This fix is available with Dev Containers 0.360.0-pre-release. Let us know if this works, thanks! |
Testing Dev Containers 0.360.0-pre-release when the local image exist and works. Let me know if you need other logs from my side of if I should post on other GitHub issue. Thanks! [2024-04-19T14:07:43.813Z] STEP 1/9: FROM localhost/hub.docker.mycorp.net/my_repo/base:latest
[2024-04-19T14:07:43.816Z] Trying to pull localhost/hub.docker.mycorp.net/my_repo/base:latest...
[2024-04-19T14:07:43.818Z] WARN[0000] Failed, retrying in 2s ... (1/3). Error: initializing source docker://localhost/hub.docker.mycorp.net/my_repo/base:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
[2024-04-19T14:07:45.820Z] WARN[0002] Failed, retrying in 2s ... (2/3). Error: initializing source docker://localhost/hub.docker.mycorp.net/my_repo/base:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
[2024-04-19T14:07:47.822Z] WARN[0004] Failed, retrying in 2s ... (3/3). Error: initializing source docker://localhost/hub.docker.mycorp.net/my_repo/base:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
[2024-04-19T14:07:49.825Z] Error: creating build container: initializing source docker://localhost/hub.docker.mycorp.net/my_repo/base:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused |
Thanks @lgonzalezsa! I need to add a check if there is already a registry name since we go through the same code path with that. PR is out: devcontainers/cli#810 |
Using the pre-release channel resolved this issue for me. |
@lgonzalezsa The updated fix is available with Dev Containers 0.361.0-pre-release. Please give that a try, thanks! |
Awesome! works for me! |
When creating a devcontainer from a Dockerfile using Podman, VSCode hangs because Podman doesn't pull from
localhost/
when using the--platform
build arg. Because the terminal Dev Container terminal window can't be interacted with at all, this means VSCode hangs forever and the only way to stop it is to kill VSCode.The Dockerfile builds correctly ("Successfully tagged localhost/vsc-podman....") and then VSCode does some additional setup using the
/tmp/devcontainercli-kyle/updateUID.Dockerfile-0.58.0
file, which has the following first two lines:BASE_IMAGE=vsc-podman-devcontainer-41....53dbb
is being set in thepodman build
command. The issue is thatpodman build
prompts for the registry as shown in the image below:.devcontainer/devcontainer.json
If I use the
image
option, the container is created correctly. It only fails whenBASE_IMAGE
is a local image..devcontainer/Dockerfile
Workaround:
/etc/containers/registries.conf
only has oneunqualified-search-registries
, podman won't prompt for a selection so the container creation will work correctly.After it fails, manually run the command that hung, choosing any prompted registry (it doesn't matter, Podman pulls locally regardless).Edit: After further testing this isn't true. VSCode tries to rebuild it regardless.build
option. Edit: Usingfeatures
also causes new containers to be built, so this workaround only works if you don't use devcontainer features.The text was updated successfully, but these errors were encountered: