Table of Contents
Overview
- Rootless docker is the is the new function launched in docker version v19.03 which help to run docker without giving root permission.
- Although there are podman by Redhat which provide this same functionality.
- Let us see how to setup rootless docker.
Installation of Rootless Docker
Before Installation of rootless docker you should not have any version of docker installed in your computer.
To check run
Sudo docker --version
Step 1
curl -fsSL https://get.docker.com/rootless | sh
Fig: Installation of rootless docker
As during installation, I met with an error solve it by running this :-
sudo sh -eux <<EOF # Install newuidmap & newgidmap binaries apt-get install -y uidmap EOF
Run step 1 again
curl -fsSL https://get.docker.com/rootless | sh
Now our rootless docker is ready to run.
But just wait I found another error when I restarted my computer error looks like this
So, I just started to do research and I found solution.
Add this to:-
~/.bashrc export PATH=/usr/bin:$PATH export DOCKER_HOST=unix:///run/user/1000/docker.sock
Now we are ready to run rootless docker
Fig: Rootless docker ran successfully
Fig: Command to check rootless docker running as rootfull or rootless (we can see all process is running rootless)
Limitations of rootless docker
- Cgroups (including docker top, which depends on the cgroups) not supported
- By default, exposing privileged TCP/UDP ports (< 1024) is forbidden (we are going to see how to allow that)
sudo setcap cap_net_bind_service=ep $HOME/bin/rootlesskit
You can also refer Docker documentation
Some advantages of docker over podman
- Docker has huge community support.
- Podman is still into nascent phase.
- Docker has docker compose but it is not available in podman in future it might be available.
- Podman is only available for Linux while docker is cross platform.
- You might face some random error in podman.
Leave a Reply