Repository navigation
build(devcontainer): add ping, traceroute, mtr, nc and tcpdump - #5354
Merged
Merged
Conversation
The devcontainer image had no basic network diagnostics tools. The system-package step of the image now installs iputils-ping, iputils-tracepath, traceroute, mtr-tiny, netcat-openbsd and tcpdump. A feature of the image installs dig and nslookup already. Debian's ping opens an ICMP echo socket and has no file capability, and Podman lets only group 0 open one. The run argument --sysctl=net.ipv4.ping_group_range=1000 1000 lets the group of vscode open the socket. Under rootless Podman with keep-id, gid 1000 maps to the lowest host ID of the container, so the range starts at 1000. The value 0 2147483647 stops the container at its start, because the user namespace does not map the upper bound. The workspace and the scaffolded devcontainer get the same run arguments. mtr-packet gets cap_net_raw from its package. tcpdump needs sudo. docs/DEVCONTAINER_USAGE.md gives these limits and the pasta limit for ICMP path traces. A person must rebuild the devcontainer.
The smoke action starts the built image as vscode with the run argument --sysctl net.ipv4.ping_group_range=1000 1000. It fails when ping, tracepath, traceroute, mtr, nc or tcpdump is not on the path, or when ping -c 1 127.0.0.1 fails. The test of the Dockerfile reads only text. The manual configuration of docs/DEVCONTAINER_USAGE.md holds the run argument. The document says when ping needs sudo: with no run argument under rootless Podman, and when the gid of vscode is not 1000.
Owner
Author
Owner action: rebuild the devcontainerAfter the release publishes the image, rebuild the devcontainer ( Limits (in Differences from the issue
Review fixes (reviewer)
Checks run
Render diffThe change touches no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The devcontainer image installs
iputils-ping,iputils-tracepath,traceroute,mtr-tiny,netcat-openbsdandtcpdumpwith its other system packages, so a person can find the cause of a network fault in the container.digandnslookupare in the image already.runArgsof the workspace and of thedevops devcontainer inittemplate add--sysctl=net.ipv4.ping_group_range=1000 1000, sovscode(gid 1000) runspingwith nosudo. The value of the issue,0 2147483647, stops the container under rootless Podman, because its user namespace does not map that gid.mtr-packetgetscap_net_rawfrom its package.tcpdumpneedssudo, because a file capability lets each user of the container capture packets.The smoke action of the image checks the six commands and a
pingasvscode.docs/DEVCONTAINER_USAGE.mdgives the tools and their limits.Closes #5343
Change:
openspec/changes/archive/2026-11-13-5343-devcontainer-network-tools/