Skip to content

Instantly share code, notes, and snippets.

@ali5h
Last active June 26, 2017 14:23
Show Gist options
  • Save ali5h/6facd36106e6789060e5077c55387bb2 to your computer and use it in GitHub Desktop.
Save ali5h/6facd36106e6789060e5077c55387bb2 to your computer and use it in GitHub Desktop.
Enabling user namespace mapping for docker in CentOS

Enabling user namespace mapping for docker in CentOS

$ grubby --args="user_namespace.enable=1" --update-kernel=$(grubby --default-kernel)
$ reboot
....
$ useradd --system --shell /bin/false --no-create-home dockremap
$ echo "dockremap:165536:65536" | tee /etc/subuid > /etc/subgid
$ cat /etc/subuid
dockremap:165536:65536

$ cat /etc/docker/daemon.json
{
...
  "userns-remap": "default",
...
}
$ service docker start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment