Last active
November 2, 2020 19:08
-
-
Save userdocs/48b3b3e628806173663f7a1ea9c34269 to your computer and use it in GitHub Desktop.
Docker rootless installation
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
## 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