Skip to content

major: Set MTU for docker globally to 1400#476

Merged
venkatamutyala merged 1 commit intomainfrom
venkatamutyala-patch-3
Apr 26, 2026
Merged

major: Set MTU for docker globally to 1400#476
venkatamutyala merged 1 commit intomainfrom
venkatamutyala-patch-3

Conversation

@venkatamutyala
Copy link
Copy Markdown
Contributor

Configure Docker MTU settings and restart service.

Configure Docker MTU settings and restart service.
Copilot AI review requested due to automatic review settings April 26, 2026 20:42
@venkatamutyala venkatamutyala merged commit 6238204 into main Apr 26, 2026
3 checks passed
@venkatamutyala venkatamutyala deleted the venkatamutyala-patch-3 branch April 26, 2026 20:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Configures Docker’s daemon MTU to 1400 during developer environment setup by writing a Docker daemon config and restarting the Docker service.

Changes:

  • Write /etc/docker/daemon.json with {"mtu": 1400} during setup
  • Restart Docker after applying the MTU setting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread developer-setup.sh

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo mkdir -p /etc/docker && echo '{"mtu": 1400}' | sudo tee /etc/docker/daemon.json > /dev/null && sudo systemctl restart docker
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command overwrites /etc/docker/daemon.json unconditionally. If the host already has Docker daemon configuration (e.g., registry-mirrors, insecure-registries, log-driver, etc.), this will clobber it and may break Docker on reruns. Consider preserving existing JSON and only setting/overriding the "mtu" key (e.g., read existing file if present and merge), or gate the write behind a check when the file doesn’t exist.

Suggested change
sudo mkdir -p /etc/docker && echo '{"mtu": 1400}' | sudo tee /etc/docker/daemon.json > /dev/null && sudo systemctl restart docker
sudo mkdir -p /etc/docker
TMP_DOCKER_DAEMON_JSON=$(mktemp)
if sudo test -s /etc/docker/daemon.json; then
sudo python3 -c 'import json; import sys; p = sys.argv[1]; data = json.load(open(p)); data["mtu"] = 1400; json.dump(data, sys.stdout)' /etc/docker/daemon.json | sudo tee "$TMP_DOCKER_DAEMON_JSON" > /dev/null
else
echo '{"mtu": 1400}' | sudo tee "$TMP_DOCKER_DAEMON_JSON" > /dev/null
fi
sudo mv "$TMP_DOCKER_DAEMON_JSON" /etc/docker/daemon.json
sudo systemctl restart docker

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants