Nowadays Docker can be installed in at least two ways, which the Docker installer presents as a choice at startup:
- a traditional mode (to execute
dockerfrom root, or usingsudo docker) - also a rootless mode (to execute docker from non-root and non-sudoer)
Some people install Docker "rootless" by mistake in their current user (example: id:gid 1000:1000), thinking that "it's the option to run Docker from the normal user with sudo docker, and then they discover they picked the wrong choice, and they want to rollback to the traditional version (bonus point: without removing that user). They discover it's not compatible anymore with their workflows, for example because the bind mount is always mounted by root:root inside the container (see Permission denied in rootless docker with non-primary group access).
The documentation about how to remove a traditional Docker but it seems not enough for uninstalling the rootless version from an already-existing user while keeping the user (see https://github.com/docker/docker-install/issues/166).
Question:
How do I uninstall "Docker rootless" from an user, keeping that user? for example, in Ubuntu, or Debian-based systems?
Purpose: switch to regular Docker, preserving the user. Thanks!
I tried various opinions from the mentioned issue, for example by changing "Docker context", but for some reason it was not enough to me. Or anyway, I couldn't figure out what was the minimum sequence by which I achieved my goal. I've followed too many tips from that issue. It would be nice to understand the minimum steps, at least in Ubuntu or Debian-based systems.
Extra notes:
$HOME/bin/was not present in my environment (so, this was not relevant: https://github.com/docker/docker-install/issues/166#issuecomment-606582544)
apt install docker(orapt install docker-ce). If you did it this debian/ubuntu way, uninstallation would just be anapt removeaway. For the binary installer… not so much, I guess.