[docker-in-docker] Not working with Docker Desktop and Enhanced Container Isolation
@v-Mathiyarasy arbeitet bereits daran.
Seit 07.4.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
The feature docker-in-docker fails to start the docker daemon with the error message
mount: /sys/kernel/security: permission denied.
dmesg(1) may have more information after failed mount system call.
Could not mount /sys/kernel/security.
AppArmor detection and --privileged mode might break.
when using a devcontainer with the Docker Desktop Hyper-V backend and having Enhanced Container Isolation enabled.
The container is started using --privileged however there are still some restrictions:
Containers become harder to breach. For example, sensitive system calls are vetted and portions of /proc and /sys are emulated inside the container.
This part of the code that checks for AppArmor stops the start, even though it would otherwise work perfectly fine.
if [ -d /sys/kernel/security ] && ! mountpoint -q /sys/kernel/security; then
mount -t securityfs none /sys/kernel/security || {
echo >&2 'Could not mount /sys/kernel/security.'
echo >&2 'AppArmor detection and --privileged mode might break.'
}
fi
When building the container with ECI disabled and then running the built container with it enabled, everything works fine.
I would propose to either add a feature flag to disable the check or remove it altogether, however I am not too sure how many run into issues with running AppArmor inside a devcontainer base container.
- Vorherrschende Sprache
- Shell
- Sterne
- 1.5k
- Forks
- 627
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus devcontainers/features
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
devcontainers/features#1754 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
devcontainers/features#1730 ·
-
Version resolution over unauthenticated git makes feature installs fail hard, with no fallbackEvtl. vergeben @v-Kaniska244 hat das vor 48 Tagen übernommen. Offen
devcontainers/features#1726 · 2 Kommentare · 1 zugewiesene Person ·
-
[docker-in-docker] v4 with iptablesSwitchAtRuntime:true default on Ubuntu 26.04 host/devcontainer image activates iptables-legacy instead of iptables-nftEvtl. wieder frei @v-Kaniska244 hat das vor 66 Tagen übernommen, und es ist kein Pull Request offen. Offen
devcontainers/features#1709 · 1 Reaktion · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
devcontainers/features#1707 ·
Alle Issues in devcontainers/features
Ähnliche Issues
-
documentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
alunduil/alunduil-chezmoi#1002 ·
Maintainer antworten meist innerhalb von 1 Tag
-
help wanted new command
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
tldr-pages/tldr#24864 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:ci priority:low type:chore
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
crazy-goat/php-fpm-ng#1021 ·
Maintainer antworten meist innerhalb von 1 Tag