Skip to content

Instantly share code, notes, and snippets.

@casebeer
Created August 25, 2025 20:55
Show Gist options
  • Save casebeer/55827d2eafc83319aac54f3f7840afdf to your computer and use it in GitHub Desktop.
Save casebeer/55827d2eafc83319aac54f3f7840afdf to your computer and use it in GitHub Desktop.
Docker rootless initial configuration
#!/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