Repository navigation
fix: docker-in-docker on Ubuntu 26.04 — verify iptables-legacy works before switching - #1637
Conversation
…before switching, falling back to iptables-nft Agent-Logs-Url: https://github.com/devcontainers/features/sessions/af4f00a5-8bfc-472b-97e3-735ddf7a07c1 Co-authored-by: Kaniska244 <[email protected]>
Kaniska (v-Kaniska244)
left a comment
There was a problem hiding this comment.
Copilot Why assuming ubuntu-26.04 is plucky, shouldn't it be resolute?
Kaniska (v-Kaniska244)
left a comment
There was a problem hiding this comment.
Copilot Do a minor version bump of the feature as well
Kaniska (v-Kaniska244)
left a comment
There was a problem hiding this comment.
Copilot Set moby: false for resolute test. As of now, moby isn't supported by ubuntu resolute.
|
Copilot Note down this exceptional behavior for ubuntu resolute in the feature documentation. |
Added a note in |
|
For those of us already on Ubuntu 26.04, how can we use this fix? |
…ky installs (microsoft#2826) # Description The DevContainer workflow times out on every run since `ubuntu-latest` moved to Ubuntu 26.04 on 2026-11-12. `ghcr.io/devcontainers/features/docker-in-docker` at `2.16.1` always selects `iptables-legacy` in the container. The Ubuntu 26.04 kernel has no legacy iptables NAT tables, so dockerd does not start: ``` (*) Failed to start docker, retrying... ``` The `postStartCommand` then waits for `docker info` until the job reaches its 30-minute limit. Upstream fixed this in [devcontainers/features#1637](devcontainers/features#1637) and moved the selection to container start in `4.0.0`. Before that, the workflow failed often because three features download from hosts that GitHub runners cannot reach reliably. - **LLVM**: `ghcr.io/devcontainers-community/features/llvm` runs `llvm.sh` from `apt.llvm.org` and adds that apt repository. The requests to `apt.llvm.org` fail intermittently, and sometimes DNS returns only an IPv6 address that the build container cannot reach: ``` [error] Distribution 'ubuntu' in version '24.04.5 LTS (Noble Numbat)' is not supported by this script. [error] GPG key not reachable at https://apt.llvm.org/llvm-snapshot.gpg.key Connecting to apt.llvm.org (apt.llvm.org)|2a04:4e42:79::561|:443... failed: Network is unreachable. ``` The repository adds no packages. Its noble builds of LLVM 17 (`1:17.0.6~++…`) sort below Ubuntu's `1:17.0.6-9ubuntu1`, so apt installs the Ubuntu packages anyway. - **kind**: `ghcr.io/devcontainers-extra/features/kind` resolves `latest` through the GitHub API without a token. Shared runner IPs hit the rate limit, and `latest` can resolve to an alpha tag that has no release: ``` urllib.error.HTTPError: HTTP Error 403: rate limit exceeded nanolayer.installers.gh_release.resolvers.asset_resolver.AssetResolver.NoReleaseError: no release exists for repo:kubernetes-sigs/kind and tag: v0.34.0-alpha ``` - **Helm**: `ghcr.io/devcontainers/features/kubectl-helm-minikube` downloads the Helm release signature from GitHub with `curl -sSL`, without `--fail` and without a retry. When GitHub answers with an error, `curl` saves the error body as the signature file, and `gpg --verify` stops the build: ``` Verification failed! gpg: no valid OpenPGP data found. gpg: the signature could not be verified. ``` The feature also installs the latest Helm release (`v4.3.2` today), not the `v4.1.4` in `go.mod`. The Go version check also passes when the versions differ. The Go feature installs `1.24.11`, but `go.mod` requires `go 1.26.8`. With `GOTOOLCHAIN=auto`, `go version` downloads and reports `go1.26.8`. This PR: - **Docker-in-Docker**: bumps the feature `2.16.1` → `4.1.3`. That version selects `iptables-legacy` or `iptables-nft` at container start, from the kernel modules of the host. - **LLVM**: drops the feature. The `apt-deps` step installs `clang-17` and `llvm-17` from the Ubuntu archive (the same packages as before) and creates the `clang` and `llvm-strip` symlinks. - **kind**: drops the feature. `sigs.k8s.io/kind` `v0.33.0` joins the `tool` block in `go.mod`, and `go-setup` runs `go install sigs.k8s.io/kind`. `go.mod` marks tool dependencies `// indirect`, which Dependabot skips by default, so `dependabot.yaml` allows `sigs.k8s.io/kind` by name. Minor and patch updates arrive with the `k8s` group. - **Helm**: sets the `helm` option of the feature to `none`. `helm.sh/helm/v4/cmd/helm` joins the `tool` block in `go.mod`, and `go-setup` installs it with kind. `helm.sh/helm/v4` is a direct dependency, so the Helm CLI now has the version of the Helm SDK, and Dependabot updates it already. - **minikube**: sets the `minikube` option of the feature to `none`. The repository uses kind, not minikube, and the feature downloads the latest minikube release on each build. The feature still installs `kubectl`. - **Go**: sets the Go feature to `1.26.8` and runs the version check with `GOTOOLCHAIN=local`. Also pins `golangciLintVersion` to `2.11.4`, the `go.mod` version that the golangci-lint workflow builds, so that the editor lints like CI. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Built the dev container with `@devcontainers/cli` `0.90.0` (the CLI version that `devcontainers/ci` uses) on an Ubuntu 24.04 host and ran the workflow's `runCmd` in it. All steps pass, including the Go version check: ``` Ubuntu clang version 17.0.6 (9ubuntu1) Ubuntu LLVM version 17.0.6 go version go1.26.8 linux/amd64 version.BuildInfo{Version:"v4.1", GitCommit:"", GitTreeState:"", GoVersion:"go1.26.8", KubeClientVersion:"v1.36"} kind v0.33.0 go1.26.8 linux/amd64 ``` `helm` and `kind` resolve to `/go/bin`. The feature build log has no Helm download and no minikube download, and the image has no `minikube` binary. `go generate` rebuilds the eBPF objects, and `golangci-lint --version` reports `2.11.4`. Docker `29.9.3` starts in the dev container with `iptables-legacy`, the backend that the feature selects on this host. With the alternative set to `iptables-nft` by hand, dockerd also starts and `docker run` works. The Ubuntu 24.04 host cannot reproduce the Ubuntu 26.04 failure, so the DevContainer workflow run on this PR validates that path. Signed-off-by: Quang Nguyen <[email protected]>
Docker daemon fails to start on Ubuntu 26.04 (resolute) because the kernel no longer supports legacy iptables NAT tables. The install script was unconditionally switching to
iptables-legacywhenever the binary existed, regardless of kernel support.Changes
iptables-legacyactually works (-nLprobe) before switching to it; fall back toiptables-nftif legacy fails:Note:- The
-nLprobe doesn’t work during the docker container build when the installation script executes. The probe works only in the runtime when container is live. Changed the above as below.resolutecodename toDOCKER_MOBY_ARCHIVE_VERSION_CODENAMESandDOCKER_LICENSED_ARCHIVE_VERSION_CODENAMESdocker_build_ubuntu_resolutetargetingubuntu:resolutewithmoby: false(moby is not yet supported on Ubuntu resolute)2.16.1→2.17.0indevcontainer-feature.json