vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Podman Hangs

Open s3rgeym opened this issue 2 years ago • 1 comments

% 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

s3rgeym avatar Feb 06 '23 12:02 s3rgeym