Skip to content

devcontainer fail to start when using podman instead of docker #15001

Closed
algorand-devrel/bootcamp
#30
@loynoir

Description

@loynoir

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

devcontainer fail to start when using podman instead of docker

Steps to reproduce the issue:

  1. podman run hello world with normal user and root user, ensure podman is working.

  2. vscode generate ubuntu devcontainer config

All choose default

1.1. Ctrl+Shift+P

1.2. remote-containers: add dev configuration files

1.3. choose ubuntu

1.4. choose default

Generated config

.devcontainer/devcontainer.json

{
	"name": "Ubuntu",
	"build": {
		"dockerfile": "Dockerfile",
		"args": { "VARIANT": "focal" }
	},
	"settings": {},
	"extensions": [],
	"remoteUser": "vscode"
}

.devcontainer/Dockerfile

ARG VARIANT="focal"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

  1. But, user settings "remote.containers.dockerPath": "podman"

Also tested failed with "remote.containers.dockerPath": "sudo-podman"

  1. click right down reopen in container button.

Describe the results you received:
Image are built using podman, but devcontainer fail to start when using podman instead of docker

Describe the results you expected:
Devcontainer using podman start up working like when using docker.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

podman version 4.1.1

Output of podman info --debug:


Package info (e.g. output of rpm -q podman or apt list podman):

podman 4.1.1-2

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Workaround
Remove "remoteUser": "vscode".

Verified mcr.microsoft.com/vscode/devcontainers/base:0-focal has user vscode.

Guess

$ podman history --no-trunc --format "{{.CreatedBy}}" localhost/vsc-xxx-uid
/bin/sh -c #(nop) USER $IMAGE_USER
...
/bin/sh -c #(nop) USER root
RUN ... bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" ...
...

I guess podman is not switch user correctly?

Edit
Reproduce repo

https://github.com/loynoir/reproduce-podman-15001

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions