microsoft / microsoft/vscode-remote-release

Podman Hangs

Open
#7,980 4 comments 4 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Feb 20, 2023.

bug containers podman
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

% uname -a          
Linux sergey-arch 6.1.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 01 Feb 2023 17:07:39 +0000 x86_64 GNU/Linux
% code --version                                                       
1.75.0
e2816fe719a4026ffa1ee0189dc89bdfdbafb164
x64
% podman --version
podman version 4.4.0
%

Podman rootless: yes

settings.json:

{
  "dev.containers.dockerPath": "podman"
}
% cat ~/workspace/test-dev-containers/.devcontainer/devcontainer.json 
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
        "name": "Python 3",
        // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
        "image": "mcr.microsoft.com/devcontainers/python:0-3.11",
        "features": {
                "ghcr.io/devcontainers-contrib/features/poetry:2": {}
        },

        // Features to add to the dev container. More info: https://containers.dev/features.
        // "features": {},

        // Use 'forwardPorts' to make a list of ports inside the container available locally.
        // "forwardPorts": [],

        // Use 'postCreateCommand' to run commands after the container is created.
        // "postCreateCommand": "pip3 install --user -r requirements.txt",

        // Configure tool-specific properties.
        // "customizations": {},

        // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
        // "remoteUser": "root"

        "runArgs": [
                "--userns=keep-id"
        ],
        "containerEnv": {
                "HOME": "/home/vscode"
        }
}

Logs:

STEP 5/9: ARG NEW_GID
--> eeb1328b0c5
STEP 6/9: SHELL ["/bin/sh", "-c"]
WARN[0000] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> dbfcf07b4b7
STEP 7/9: RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd);         eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd);     eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group);        if [ -z "$OLD_UID" ]; then              echo "Remote user not found in /etc/passwd ($REMOTE_USER).";         elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then               echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID).";         elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then               echo "User with UID exists ($EXISTING_USER=$NEW_UID).";         elif [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then     echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID).";        else            echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.";           sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd;             if [ "$OLD_GID" != "$NEW_GID" ]; then                   sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group;        fi;              chown -R $NEW_UID:$NEW_GID $HOME_FOLDER;        fi;
UIDs and GIDs are the same (1000:1000).
WARN[0001] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> b2e07294a0a
STEP 8/9: ARG IMAGE_USER
WARN[0002] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> 254a8434cbd
STEP 9/9: USER $IMAGE_USER
COMMIT vsc-test-dev-containers-ddd343c1d6d100edff4259bcab66285d-features-uid
WARN[0002] SHELL is not supported for OCI image format, [/bin/sh -c] will be ignored. Must use `docker` format 
--> 473ca640594
Successfully tagged localhost/vsc-test-dev-containers-ddd343c1d6d100edff4259bcab66285d-features-uid:latest
473ca6405944080c39452cbabce2124cb1376248691096063ca5ef8c10d80a28
[58412 ms] Start: Run: podman -v
[58432 ms] Start: Run: podman events --format json --filter event=start
[58436 ms] Start: Starting container
[58436 ms] Start: Run: podman run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/home/sergey/workspace/test-dev-containers,target=/workspaces/test-dev-containers --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/home/sergey/workspace/test-dev-containers -l devcontainer.config_file=/home/sergey/workspace/test-dev-containers/.devcontainer/devcontainer.json -e HOME=/home/vscode --userns=keep-id --entrypoint /bin/sh vsc-test-dev-containers-ddd343c1d6d100edff4259bcab66285d-features-uid -c echo Container started

Container started hangs. I wait 15 minutes...

How to fix it?

When I restart VS Code and open a folder in container, it's work

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.