Skip to content

Instantly share code, notes, and snippets.

@userdocs
Last active November 2, 2020 19:08
Show Gist options
  • Save userdocs/48b3b3e628806173663f7a1ea9c34269 to your computer and use it in GitHub Desktop.
Save userdocs/48b3b3e628806173663f7a1ea9c34269 to your computer and use it in GitHub Desktop.
Docker rootless installation
## https://docs.docker.com/engine/security/rootless
## Debian Specific
echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/10-docker.conf \
&& sysctl --system
echo "options overlay permit_mounts_in_userns=1" > /etc/modprobe.d/10-docker.conf \
&& modprobe overlay permit_mounts_in_userns=1
apt-get install -y uidmap
## run this as local user
curl -fsSL https://get.docker.com/rootless | sh
export PATH="/sbin${PATH:+:${PATH}}"
export DOCKER_HOST="unix:///run/user/1000/docker.sock"
## A test docker with a build script
~/bin/docker run -it -p 8112:8112 -v $HOME:/root alpine:latest /bin/ash -c 'apk add bash curl && curl -sL git.io/mplibtorrent | bash -s all install && cd && ash'
## service management
systemctl --user start docker
systemctl --user stop docker
systemctl --user restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment