Repository navigation
Closed
Description
base system:
- Ubuntu 26.04 LTS
- Host Docker Engine Community 29.5.0, API 1.54 (min API 1.40)
devcontainer configuration
{
"name": "morbyd (docker-in-docker)",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:3": {
"version": "latest",
"moby": false // go for the upstream Docker-CE
},
//"ghcr.io/thediveo/devcontainer-features/local-pkgsite:0": {},
//"ghcr.io/thediveo/devcontainer-features/goreportcard:0": {},
//"ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:0": {},
//"ghcr.io/thediveo/devcontainer-features/lazygit:0": {},
//"ghcr.io/thediveo/devcontainer-features/gocover:0": {
// "tags": "matchers",
// "uncovered-packages": "github.com/thediveo/morbyd/v2/run/dockercli",
// "num-programs": "1",
// "race": true,
// "verbose": true,
// "html": true
//},
//"ghcr.io/thediveo/devcontainer-features/pin-github-action:0": {}
},
"remoteEnv": {
"GOPATH": "/home/vscode/go",
"PATH": "/home/vscode/go/bin:/go/bin:/usr/local/go/bin:${localEnv:PATH}"
},
"postCreateCommand": "go install go.uber.org/mock/mockgen@latest",
"customizations": {
"vscode": {
"extensions": [
"stkb.rewrap",
"brunnerh.insert-unicode",
"mhutchie.git-graph",
"ms-vscode.makefile-tools",
"redhat.vscode-yaml"
]
}
}
}As you can see from the above configuration, still using the 24.04 base image here. Inside the devcontainer, docker ps fails with Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ps faux shows this interesting part:
root 1 0.0 0.0 1168 780 ? Ss 16:34 0:00 /sbin/docker-init -- /bin/sh -c echo Container started trap "exit 0" 15 /usr/local/share/docker-init.sh exec "$@" while sleep 1 & wait $!; do :; done -
root 7 0.0 0.0 2808 1908 ? S 16:34 0:00 /bin/sh -c echo Container started trap "exit 0" 15 /usr/local/share/docker-init.sh exec "$@" while sleep 1 & wait $!; do :; done -
root 8290 0.0 0.0 2704 1616 ? S 16:39 0:00 \_ sleep 1
root 7216 0.0 0.0 2754320 46048 ? Sl 16:35 0:00 /usr/bin/containerd --config /etc/containerd/config.toml
So, containerd runs and responds to sudo ctr version, but dockerd is missing.
I've removed all containers, images and volumes, but to no avail. Always same problem.
Disabling all features except for docker-in-docker still shows the failure.
Reacted by Flo, Alex Bailey and Dave Tapley
Metadata
Metadata
Assignees
Labels
No labels
Activity
v-Kaniska244 commentedon May 25, 2026
Hi TheDiveO (@thediveo)
Thank you for reporting this issue. I have tried with the exact same setup as reported but it doesn't seem to be reproducing for the moment with either docker-in-docker
v2orv3features.Would you be able to help with the following information which could help us to investigate this further:
x86_64orarm64CPU architecture?max06 commentedon May 25, 2026
I can provide details from my failing system:
moby: falseis set due to debian trixie image used for the devcontainer.I'm running nixos unstable with nftables on my host system.
Log-file:
Running
Linux d9839fdacdec 7.0.8 #1-NixOS SMP PREEMPT_DYNAMIC Fri May 15 12:53:54 UTC 2026 x86_64 GNU/Linux.Happy to run any tests if needed.
thediveo commentedon May 25, 2026
Not in a CI pipeline. This is when using VSCode 1.121.0 on Ubuntu Linux 26.04 with amd64 architecture with upstream Docker CE installed in the host, then using Shift+Ctrl P, Devcontainer: Open Workspace in Container.
The dev container builds correctly and starts.
Sure, with pleasure. Following are the complete
docker.logcontents.Containerd loads successfully:
thediveo commentedon May 25, 2026
I've noticed that contrary to the image documentation on https://hub.docker.com/r/microsoft/devcontainers-base there is no
ubuntu-26.04tag:However, mcr.microsoft.com/devcontainers/base:ubuntu now refers to an image with
lsb_release -aidentifying it as Ubuntu 26.04.The v3 d-in-d feature correctly starts dockerd in this configuration.
v-Kaniska244 commentedon May 26, 2026
Hi TheDiveO (@thediveo) , Hi Flo (@max06)
Thank you for all the details. From the error it looks like we need revisit the iptables switching logic fix as Docker-in-Docker uses the host kernel's
netfiltermodules (containers don't have their own kernel). Ubuntu 26.04's kernel has dropped theiptable_nat / legacy ip_tablesmodules in favor ofnf_tables. So iptables-legacy inside the container can't initialize the nat table no matter what as the kernel module doesn't exist on the host. Would you kindly see if changing the container base image to resolute helps in this case or not.max06 commentedon May 26, 2026
Good morning @Kaniska244,
I think the logic is flawed.
It looks like you're trying to figure out if you have to use nf instead of iptables based on the container-os, while it actually depends on the host-os kernel. I'm running
debian:trixiein my container, the install script setsuse_nftonly for resolute. But my kernel (nixos) requires nf, so the startup fails.From inside the devcontainer, I can use two options to test for netfilter and/or iptables:
Both tests confirm netfilter on my system.
I'd recommend changing the start-script.
Edit:
Sorry, I need to reword my answer. I just repeated what you wrote and assumed your intention considering the suggested test as a solution candidate. Your suggestion works. Your combination of showing the correct root cause and testing a fix based on an unrelated input threw me off. I jumped to wrong conclusions.
However: I'd like to suggest creating a proper fix that tests the actual host system instead of using if-conditions and code-names, but you probably already had that in mind.
I swear, I'm not an LLM. Just a human with some communication problems. And not enough coffee.
thediveo commentedon May 26, 2026
...and in my original configuration the host had been upgraded to Ubuntu resolute, but the devcontainer image was still 24.04 noble, thus again the wrong decision regarding which way to address nftables.
thediveo commentedon Jun 3, 2026
@Kaniska244 I've noticed that the draft bumps up to semver major 4 ... is this just for the draft or do we need to bump up later too? I have quite some devcontainer projects relying on the docker-in-docker feature, so upgrading the major all over again will be ... painful.
v-Kaniska244 commentedon Jun 8, 2026
Hi TheDiveO (@thediveo) , Hi Flo (@max06)
Would you kindly review this PR and let me know your opinion on the same. It would be very helpful to ensure the correctness of the solution and the respective test coverages.
TheDiveO (@thediveo) I have noted your remark w.r.t. the versioning. I will get back on that after a discussion with the maintainers.
thediveo commentedon Jun 8, 2026
@Kaniska244 tested your PR feature with
iptablesSwitchAtRuntime:trueas follows...(didn't try with
iptablesSwitchAtRuntime:falseas we know that should fail)thediveo commentedon Jun 25, 2026
Thank you very much for fixing this nasty problem!
ci: bump docker-in-docker devcontainer feature to v4 (#137)
ci: bump docker-in-docker devcontainer feature to v4 (#137)