-
Notifications
You must be signed in to change notification settings - Fork 258
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
Attempting to run a devcontainer using an existing docker-compose.yml fails #9895
Comments
The same issue is happening in a POP_OS env: Version: 1.88.1 Dev containers version: v0.362.0 image in dockerfile: Logs: [2024-05-18T17:59:44.065Z] Stop (131433 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-ostrock/container-features/0.59.1-1716055052627/Dockerfile-with-features -t vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer/.devcontainer
[2024-05-18T17:59:44.067Z] Start: Run: docker inspect --type image vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453
[2024-05-18T17:59:44.098Z] Stop (31 ms): Run: docker inspect --type image vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453
[2024-05-18T17:59:44.102Z] Start: Run: docker build -f /tmp/devcontainercli-ostrock/updateUID.Dockerfile-0.59.1 -t vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453-uid --platform linux/amd64 --build-arg BASE_IMAGE=vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453 --build-arg REMOTE_USER=spark --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=spark /home/ostrock/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[2024-05-18T17:59:44.376Z] [+] Building 0.0s (0/0) docker:default
[2024-05-18T17:59:44.449Z]
[2024-05-18T17:59:44.449Z] [+] Building 0.0s (0/1) docker:default
[2024-05-18T17:59:44.681Z]
[2024-05-18T17:59:44.681Z] [+] Building 0.2s (4/5) docker:default
=> [internal] load build definition from updateUID.Dockerfile-0.59.1 0.0s
=> => transferring dockerfile: 1.36kB 0.0s
=> [internal] load metadata for docker.io/library/vsc-spark-devcontainer 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/2] FROM docker.io/library/vsc-spark-devcontainer-33625aaf6e3f871ea 0.0s
=> [2/2] RUN eval $(sed -n "s/spark:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^ 0.2s
[2024-05-18T17:59:44.785Z] [+] Building 0.3s (4/5) docker:default
[2024-05-18T17:59:44.785Z]
=> [internal] load build definition from updateUID.Dockerfile-0.59.1 0.0s
=> => transferring dockerfile: 1.36kB 0.0s
=> [internal] load metadata for docker.io/library/vsc-spark-devcontainer 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/2] FROM docker.io/library/vsc-spark-devcontainer-33625aaf6e3f871ea 0.0s
=> [2/2] RUN eval $(sed -n "s/spark:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^ 0.3s
=> => # Updating UID:GID from 185:185 to 1000:1000.
[2024-05-18T17:59:44.882Z] [+] Building 0.4s (5/5) FINISHED docker:default
=> [internal] load build definition from updateUID.Dockerfile-0.59.1 0.0s
[2024-05-18T17:59:44.882Z] => => transferring dockerfile: 1.36kB 0.0s
=> [internal] load metadata for docker.io/library/vsc-spark-devcontainer 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/2] FROM docker.io/library/vsc-spark-devcontainer-33625aaf6e3f871ea 0.0s
=> ERROR [2/2] RUN eval $(sed -n "s/spark:[^:]*:\([^:]*\):\([^:]*\):[^:] 0.3s
------
> [2/2] RUN eval $(sed -n "s/spark:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd); eval $(sed -n "s/\([^:]*\):[^:]*:1000:.*/EXISTING_USER=\1/p" /etc/passwd); eval $(sed -n "s/\([^:]*\):[^:]*:1000:.*/EXISTING_GROUP=\1/p" /etc/group); if [ -z "$OLD_UID" ]; then echo "Remote user not found in /etc/passwd (spark)."; elif [ "$OLD_UID" = "1000" -a "$OLD_GID" = "1000" ]; then echo "UIDs and GIDs are the same (1000:1000)."; elif [ "$OLD_UID" != "1000" -a -n "$EXISTING_USER" ]; then echo "User with UID exists ($EXISTING_USER=1000)."; else if [ "$OLD_GID" != "1000" -a -n "$EXISTING_GROUP" ]; then echo "Group with GID exists ($EXISTING_GROUP=1000)."; NEW_GID="$OLD_GID"; fi; echo "Updating UID:GID from $OLD_UID:$OLD_GID to 1000:1000."; sed -i -e "s/\(spark:[^:]*:\)[^:]*:[^:]*/\11000:1000/" /etc/passwd; if [ "$OLD_GID" != "1000" ]; then sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\11000:/" /etc/group; fi; chown -R 1000:1000 $HOME_FOLDER; fi;:
0.255 Updating UID:GID from 185:185 to 1000:1000.
0.261 chown: cannot access '/home/spark': No such file or directory
------
[2024-05-18T17:59:44.885Z] updateUID.Dockerfile-0.59.1:10
--------------------
9 | SHELL ["/bin/sh", "-c"]
10 | >>> RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd); \
11 | >>> eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd); \
12 | >>> eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group); \
13 | >>> if [ -z "$OLD_UID" ]; then \
14 | >>> echo "Remote user not found in /etc/passwd ($REMOTE_USER)."; \
15 | >>>
[2024-05-18T17:59:44.885Z] elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then \
16 | >>> echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID)."; \
17 | >>> elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then \
18 | >>> echo "User with UID exists ($EXISTING_USER=$NEW_UID)."; \
19 | >>> else \
20 | >>> if [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then \
21 | >>> echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID)."; \
22 | >>> NEW_GID="$OLD_GID"; \
23 | >>> fi; \
24 | >>> echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID."; \
25 | >>> sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd; \
26 | >>> if [ "$OLD_GID" != "$NEW_GID" ]; then \
27 | >>> sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group; \
28 | >>> fi; \
29 | >>> chown -R $NEW_UID:$NEW_GID $HOME_FOLDER; \
30 | >>> fi;
31 |
--------------------
ERROR: failed to solve: process "/bin/sh -c eval $(sed -n \"s/${REMOTE_USER}:[^:]*:\\([^:]*\\):\\([^:]*\\):[^:]*:\\([^:]*\\).*/OLD_UID=\\1;OLD_GID=\\2;HOME_FOLDER=\\3/p\" /etc/passwd); \teval $(sed -n \"s/\\([^:]*\\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\\1/p\" /etc/passwd); \teval $(sed -n \"s/\\([^:]*\\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\\1/p\" /etc/group); \tif [ -z \"$OLD_UID\" ]; then \t\techo \"Remote user not found in /etc/passwd ($REMOTE_USER).\"; \telif [ \"$OLD_UID\" = \"$NEW_UID\" -a \"$OLD_GID\" = \"$NEW_GID\" ]; then \t\techo \"UIDs and GIDs are the same ($NEW_UID:$NEW_GID).\"; \telif [ \"$OLD_UID\" != \"$NEW_UID\" -a -n \"$EXISTING_USER\" ]; then \t\techo \"User with UID exists ($EXISTING_USER=$NEW_UID).\"; \telse \t\tif [ \"$OLD_GID\" != \"$NEW_GID\" -a -n \"$EXISTING_GROUP\" ]; then \t\t\techo \"Group with GID exists ($EXISTING_GROUP=$NEW_GID).\"; \t\t\tNEW_GID=\"$OLD_GID\"; \t\tfi; \t\techo \"Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.\"; \t\tsed -i -e \"s/\\(${REMOTE_USER}:[^:]*:\\)[^:]*:[^:]*/\\1${NEW_UID}:${NEW_GID}/\" /etc/passwd; \t\tif [ \"$OLD_GID\" != \"$NEW_GID\" ]; then \t\t\tsed -i -e \"s/\\([^:]*:[^:]*:\\)${OLD_GID}:/\\1${NEW_GID}:/\" /etc/group; \t\tfi; \t\tchown -R $NEW_UID:$NEW_GID $HOME_FOLDER; \tfi;" did not complete successfully: exit code: 1
[2024-05-18T17:59:44.892Z] Stop (790 ms): Run: docker build -f /tmp/devcontainercli-ostrock/updateUID.Dockerfile-0.59.1 -t vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453-uid --platform linux/amd64 --build-arg BASE_IMAGE=vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453 --build-arg REMOTE_USER=spark --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=spark /home/ostrock/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[2024-05-18T17:59:44.893Z] Error: Command failed: docker build -f /tmp/devcontainercli-ostrock/updateUID.Dockerfile-0.59.1 -t vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453-uid --platform linux/amd64 --build-arg BASE_IMAGE=vsc-spark-devcontainer-33625aaf6e3f871ea5f5825e2c1bc1653b9b958d88757dde90e59dc791623453 --build-arg REMOTE_USER=spark --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=spark /home/ostrock/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[2024-05-18T17:59:44.894Z] at ptA (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:464:1260)
[2024-05-18T17:59:44.894Z] at NH (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:464:1002)
[2024-05-18T17:59:44.895Z] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024-05-18T17:59:44.895Z] at async KtA (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:481:3692)
[2024-05-18T17:59:44.895Z] at async $C (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:481:4807)
[2024-05-18T17:59:44.895Z] at async hrA (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:661:13255)
[2024-05-18T17:59:44.895Z] at async lrA (/home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js:661:12996)
[2024-05-18T17:59:44.915Z] Stop (133253 ms): Run: /usr/share/code/code /home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/ostrock/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-ebf2d76f-5b28-4a53-abbe-df813da930761716055048947 --workspace-folder /home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer --id-label devcontainer.config_file=/home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer/.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
[2024-05-18T17:59:44.916Z] Exit code 1
[2024-05-18T17:59:44.934Z] Command failed: /usr/share/code/code /home/ostrock/.vscode/extensions/ms-vscode-remote.remote-containers-0.362.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/ostrock/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-ebf2d76f-5b28-4a53-abbe-df813da930761716055048947 --workspace-folder /home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer --id-label devcontainer.config_file=/home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/ostrock/Insync/guilherme@ostrock.com.br/OneDrive/Code/spark-devcontainer/.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
[2024-05-18T17:59:44.934Z] Exit code 1 |
I'm wondering if this was a Docker issue. I noticed a Docker update to 4.30.0. After installing that, I can't reproduce this issue anymore. Nothing is obvious in the release notes, but it seems like the only relevant change since I didn't apply any updates to VS Code or any plugins. I'll leave this open in case there is an investigation or something else to do, but it does look like my problem is resolved (for now). |
@ThomasOwens It was complaining that the container wasn't running, maybe the entrypoint's process exited unexpectedly? @Ostrock This looks like an issue with your Dockerfile: |
VSCode Version: 1.89.1
Local OS Version: Windows 11 Pro 10.0.22621 Build 22621
Remote OS Version:
Remote Extension/Connection Type: Dev Container
Logs:
Steps to Reproduce:
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Unsure.
The text was updated successfully, but these errors were encountered: