Uninstall Rootless Docker

Introduction

In May of this year, I posted an article Building Rootless Docker, but for some reason I decided to uninstall rootless docker. The following is a summary of the uninstallation procedure. I will post the details of the circumstances that led to the uninstallation of rootless docker later.

Sources

  • The original manual - The rootless mode section of the docker manual. There are uninstall instructions in the latter part of the manual.

Uninstallation instructions

Removing docker daemon service

$ dockerd-rootless-setuptool.sh uninstall

Remove DOCKER_HOST line in .bashrc

Delete (comment out) the following line in .bashrc.

#export DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/docker.sock

remove data directory.

$ rootlesskit rm -fr ~/.local/share/docker

Remove installed packages

$ sudo apt remove docker-ce-rootless-extras

Modify containerd config file

Fix the following in /etc/nvidia-container-runtime/config.toml (from true to false)

no-cgroups = false

Without the above modification, when using gpu (for example, when running “$ sudo docker run -it –rm –gpus all ubuntu nvidia-smi”), the following error occurs.

Failed to initialize NVML: Unknown Error

docker daemon to start

The second line is required to auto-start the daemon at boot time.

$ sudo service docker start
$ sudo systemctl enable docker

Verify that it works correctly

$ sudo docker run hello-world
$ sudo docker run -it --rm --gpus all ubuntu nvidia-smi