Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to uninstall Docker Rootless mode ? #166

Closed
thinh105 opened this issue Mar 31, 2020 · 10 comments
Closed

How to uninstall Docker Rootless mode ? #166

thinh105 opened this issue Mar 31, 2020 · 10 comments

Comments

@thinh105
Copy link

I'm new for the town, so I'm sorry to ask something stupid,

I cannot uninstall Docker Rootless mode,

I try sudo apt-get remove docker docker-engine docker.io containerd runc but it not working,

I don't know how to do because it's still new and there is not so much document or article about that,

Thanks

@thaJeztah
Copy link
Member

Rootless install doesn't use the apt packages (as those can only be installed globally, and as such require root / sudo to install). Instead, it uses static binaries, and installs them inside your home directory (in $HOME/bin/).

We should probably add some documentation about uninstalling those (/cc @AkihiroSuda)

@AkihiroSuda
Copy link
Contributor

Probably we should add uninstaller to moby/moby#40707

@AkihiroSuda
Copy link
Contributor

The current uninstall steps:

$ rootlesskit rm -rf ~/.local/share/docker
$ cd ~/bin
$ rm -f *docker* *containerd* *runc* *rootlesskit* *vpnkit*

@thinh105
Copy link
Author

thinh105 commented Mar 31, 2020

@thaJeztah @AkihiroSuda thank you guys for the quick replys, I will try to find out

image

The current uninstall steps:

$ rootlesskit rm -rf ~/.local/share/docker
$ cd ~/bin
$ rm -f *docker* *containerd* *runc* *rootlesskit* *vpnkit*

Actually, after doing that, it stills stay strong 💃

Do I need to restart my machine or something, thanks

Update:

Look like I have to run this command to stop it:

systemctl --user stop docker

after that, it seems clean,

@thinh105 thinh105 reopened this Apr 2, 2020
@thinh105
Copy link
Author

thinh105 commented Apr 2, 2020

Now I got the bigger problem, I cannot install a normal docker,

it keeps saying that : "ERROR: Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?"

maybe after removing Docker Rootless mode, it still not come back to normal?

sudo setfacl -m user:bastian:rw /var/run/docker.sock
 docker ps                                           
Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
 sudo gpasswd -a $USER docker                        
Adding user bastian to group docker
 sudo setfacl -m user:bastian:rw /var/run/docker.sock
 docker ps
Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
 sudo setfacl -m user:bastian:rw /var/run/user/1000/docker.sock
setfacl: /var/run/user/1000/docker.sock: No such file or directory
 ✘  ~ 
 sudo setfacl -m user:bastian:rw /run/user/1000/docker.sock 
setfacl: /run/user/1000/docker.sock: No such file or directory
 ✘  ~ 
 systemctl start docker                                    
 ~ 
 docker ps
Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
 docker ps
Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
 docker info                                   
Client:
 Debug Mode: false

Server:
ERROR: Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
errors pretty printing info

@AkihiroSuda lookalike I need some another remove command to use normal docker again ?

@AkihiroSuda
Copy link
Contributor

Probably you have added DOCKER_HOST in your .bashrc

@thinh105
Copy link
Author

thinh105 commented Apr 2, 2020

finally, I just found out on rootless docs: https://docs.docker.com/engine/security/rootless/

# Make sure the following environment variables are set (or add them to ~/.bashrc):
export DOCKER_HOST=unix:///run/user/1001/docker.sock

So I went to my file (~/.zshrc ) to remove that line, and after logout/login, my docker has finally work, thank god

@thinh105 thinh105 closed this as completed Apr 2, 2020
@shubhamrajvanshi
Copy link

Documenting for Ubuntu 20.04.2 LTS users
I had to run below steps
rootlesskit rm -rf ~/.local/share/docker
systemctl --user stop docker

remove export DOCKER_HOST=unix:///run/user/1001/docker.sock from from .bashrc and logout and login

@davidkhala
Copy link

I believe this will be more appropriate

dockerd-rootless-setuptool.sh uninstall

@rdolezel
Copy link

Linux newbie here. Hard way to find rootless docker does not support macvlan (or I am not able to get it working).

My uninstall procedure:
sudo nano /etc/sysctl.conf # remove added line
nano ~/.bashrc # remove added lines
sudo loginctl disable-linger $(whoami)
systemctl --user stop docker.service
sudo rm /var/run/docker.sock # no idea why it was here but it was blocking the next command
/usr/bin/dockerd-rootless-setuptool.sh uninstall
/usr/bin/rootlesskit rm -rf /home/radek/.local/share/docker
exit # log out & log in
sudo apt remove uidmap docker-ce-rootless-extras

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants