major: Set MTU for docker globally to 1400#476
Merged
venkatamutyala merged 1 commit intomainfrom Apr 26, 2026
Merged
Conversation
Configure Docker MTU settings and restart service.
Contributor
There was a problem hiding this comment.
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.jsonwith{"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.
|
|
||
| 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 |
There was a problem hiding this comment.
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 |
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.
Configure Docker MTU settings and restart service.