Created
August 25, 2025 20:55
-
-
Save casebeer/55827d2eafc83319aac54f3f7840afdf to your computer and use it in GitHub Desktop.
Docker rootless initial configuration
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
#!/bin/bash | |
if [ -f /etc/docker/daemon.json ] ; then | |
echo "/etc/docker/daemon.json already exists, refusing to overwrite it." >&2 | |
exit 1 | |
fi | |
cat <<EOF | sudo tee /etc/docker/daemon.json | |
{ "userns-remap": "default" } | |
EOF | |
cat <<EOF | sudo tee -a /etc/subuid | |
dockremap:200000:65536 | |
EOF | |
cat <<EOF | sudo tee -a /etc/subgid | |
dockremap:200000:65536 | |
EOF | |
# Restart docker daemon: | |
sudo systemctl restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment