Skip to content

Cannot build devcontainers features #605

@olivierlemasle

Description

@olivierlemasle

When using vscode on Flatpak with podman and devcontainers as suggested here, builing of devcontainer feature fails.

The cause is that this involves building a container image with a build context which is not shared with the host:

[1/2] STEP 3/4: COPY --from=dev_containers_feature_content_source devcontainer-features.builtin.env /tmp/build-features/
Error: building at STEP "COPY --from=dev_containers_feature_content_source devcontainer-features.builtin.env /tmp/build-features/": checking on sources under "/tmp/devcontainercli-user/container-features/0.79.0-1753825289342": error in copier subprocess: changing to intended-new-root directory "/tmp/devcontainercli-user/container-features/0.79.0-1753825289342": chdir /tmp/devcontainercli-user/container-features/0.79.0-1753825289342: no such file or directory
Stop (729 ms): Run: podman-remote buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 --no-cache --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
Error: Command failed: podman-remote buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 --no-cache --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder

Here, the failing command is:

podman-remote buildx build --load \
  --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 \
  --no-cache \
  --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm \
  --build-arg _DEV_CONTAINERS_IMAGE_USER=root \
  --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp \
  --target dev_containers_target_stage \
  -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended \
  -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features \
  /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder

and it fails because the build context is not accessible from the host, where podman is running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions