devcontainers / devcontainers/features

[Docker-in-Docker] Missing option to restart docker from inside the devcontainer

Offen
#357 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
1.5k
Forks
621
Ø Merge
6 T. 53 Min.
Gemergte PRs (30 T.)
9

Beschreibung

Using default devcontainer setup:

"name": "Docker in Docker",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
}
}

The problem I experienced is, when I have changed my MTU on my host docker to e.g. 1332 I get connection disconnects inside the containers in my devcontainer environment. This is due to mismachting MTU values. Resetting my MTU on my host to 1500 resolves this problem.

So far this is no problem. Adjusting the MTUs accordingly should solve my issues, but I have to restart the docker daemon inside the devcontainer for that. Trying `systemctl restart docker` yields following message:

> "systemd" is not running in this container due to its overhead.
> Use the "service" command to start services instead. e.g.:
>
> service --status-all

Executing `service --status-all` yields:

> [ ? ] hwclock.sh
> [ - ] procps
> [ - ] rsync
> [ - ] sudo

It's also necesscary to be able to enable IPv6 for Docker ;)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Feature ghcr.io/devcontainers/features/docker-in-docker:2 und reproduziere die Standardkonfiguration anhand der gezeigten Optionen. Prüfe, wie Docker innerhalb des devcontainer gestartet wird, statt dich auf systemctl zu verlassen, und verifiziere anschließend, dass der angeforderte Neustartpfad und die IPv6-Unterstützung nach einer Änderung der Host-MTU funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, shell
Bereich
devops, infrastructure
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.