Repository navigation
devcontainer with features - podman error relabel #10585
Description
Activity
cedric-orange commented
on Dec 19, 2024 AuthorMore actionsIf I edit generated Dockerfile
container-features/0.72.0-1734645749964/Dockerfile.extendedAnd replace line:
RUN --mount=type=bind,from=dev_containers_feature_content_source,source=hello_0,target=/tmp/build-features-src/hello_0,z \by:
RUN --mount=type=bind,from=dev_containers_feature_content_source,source=hello_0,target=/tmp/build-features-src/hello_0 \And relaunch manualy:
podman buildx build --load --build-context dev_containers_feature_content_source=/tmp/user/1000/devcontainercli-wgwb8517/container-features/0.72.0-1734645749964 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:ubuntu --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/user/1000/devcontainercli-wgwb8517/container-features/0.72.0-1734645749964/Dockerfile.extended -t vsc-methone-image-e6feb3b9a9328819577c3b28f7f1b0aecb646d4f17f7eedc9e5f8b4c85625497-features /tmp/user/1000/devcontainercli-wgwb8517/empty-folderCommand success.
- addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
on Dec 19, 2024 We added the
zflag for Podman in devcontainers/cli#548. Any idea why it does not work in your case?- addedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Dec 20, 2024 cedric-orange commented
on Dec 20, 2024 AuthorMore actionsI have more information:
It's containerd update which breaks this containerd.io:amd64 (1.7.23-1, 1.7.24-1)
When I downgrade to containerd 1.7.23, it's ok for me.
We added the
zflag for Podman in devcontainers/cli#548. Any idea why it does not work in your case?I am facing the same problem when using Podman. When looking at the Podman documentation, the error message actually makes sense: the
zflag is not a valid option for--mountand is only supported by--volume. This is consistent with how it works inDocker. Did this change since you added the flag?Removing the
zflag works for me as I am not in an SELinux context.We added the
zflag for Podman in devcontainers/cli#548. Any idea why it does not work in your case?I am facing the same problem when using Podman. When looking at the Podman documentation, the error message actually makes sense: the
zflag is not a valid option for--mountand is only supported by--volume. This is consistent with how it works inDocker. Did this change since you added the flag?Removing the
zflag works for me as I am not in an SELinux context.I can confirm that the error does not occur on a different system with the same Podman version where SELinux is enabled.
Mario Loriedo (@l0rd) Do you know if
--security-opt label=disablehas better compatibility? Iszfailing on all systems without SELinux?These are different options:
--security-opt label=disabledisables the SELinux labels check, whereaszrelabel every file object in the volume and can have undesired side effects.There is no option
zfor--mount. The optionzof--volumecorresponds to the optionrelable=shareof--mount. The example provided in the documentation:--mount=type=bind,src=/path/on/host,dst=/path/in/container,relabel=sharedReacted by Jaroslav HennerReacted by Jaroslav HennerThanks, I also see
podman builddoesn't support--security-opt label=disable. It appears thatzwas supported in earlier versions of buildah. Isrelabel=sharethe right approach for these folders that we use to bring install scripts into the build? I think the scripts might write to these folders, so I'm not sure we could make them read-only.The
--security-opt=label=disableshould work forpodman buildtoo.Anyway I suppose that in the build scenario you control the mounted folders (i.e. these are temporary folders that you manage, not users). So using the relabel option
zis a valid option too as there is no risk to update labels of system files.The relabel option made it into buildah 1.31.0 (podman-container-tools/buildah#4705) in 2023.
--security-opt=label=disablemight have been around for longer, but I couldn't find documentation on that. Any recommendation on what would be best? We could parse out the buildah version if that's necessary.--security-opt=label=disablemakespodmanbehave likedocker,which should be easier to maintain. Inspecting the git history, it looks likedisablewas there from the very beginning ofPodmanBuildah.Reacted by Christof Marti- addedcontainersIssue in vscode-remote containersIssue in vscode-remote containersand removedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Jun 16, 2025 I was also experiencing the same issue with VSCode + WSL (Ubuntu 24.04) + VSCode Extension: Dev Containers (0.417.0) + podman environment.
Let me share what I found:- In Mount build context as shared with buildah devcontainers/cli#696, when using podman, the "bind" option now passes "z"
- In configs: validate: add validation for bind-mount fsflags opencontainers/runc#3990, from runc v1.2.0-rc.1 onwards, passing "z" in "bind" options causes an error
- containerd 1.7.23 was using runc v1.1.14. containerd 1.7.24 was using runc v1.2.2 (which is why this doesn't occur in containerd 1.7.23)
- As a test, when I downgraded only runc to v1.1.15, it worked in my environment
I'm not very familiar with the details, but if we respect runc's behavior, I feel we should temporarily not add "bind" option.
I see it is still working with
crun. I will look into using--security-opt=label=disablefor better compatibility.- added 4 commits that reference this issue
on Jul 10, 2025 Fixed in Dev Containers 0.424.0-pre-release. Let me know if this works for you, thanks!
I upgraded to devcontainer v0.424.0 in VSCode's Extension and now it works on runc v1.2.5 in my environment!
Reacted by Raymond Zhao- locked and limited conversation to collaborators
on Aug 28, 2025
Destination:/tmp/build-features-src/hello_0 Device:bind Flags:20481 ClearedFlags:0 PropagationFlags:[262144] Data:z Relabel: RecAttr:<nil> Extensions:0 IDMapping:<nil>}: bind mounts cannot have any filesystem-specific options applied"Steps to Reproduce:
1.Use this devcontainer.json:
About my podman configuration