I deleted docker with:
sudo snap remove docker --purge
Then, I install docker following the doc guide (this)
All looks fine, but when I do:
$ docker -v
-bash: /snap/bin/docker: No such file or directory
It's like it still look for it in snap.
I tried:
$ sudo snap refresh --list
But doesn't work. Any idea?
It seems that the problem is for alias.
try this command whereis docker
the output is some thing like this:
docker: /usr/bin/docker /etc/docker /usr/libexec/docker /usr/share/man/man1/docker.1.gz
now set new alias to docker.
alias docker='/usr/bin/docker'
try again the problem should be solved.
Related
Sorry if this is obvious, I'm new to docker.
I forgot how I installed docker-compose, so I tried:
$ which docker-compose
/snap/bin/docker-compose
I tried to uninstall it via snap:
$ sudo snap remove docker-compose
snap "docker-compose" is not installed
$ sudo rm -r docker-compose
rm: cannot remove 'docker-compose': No such file or directory
But here's the problem:
docker-compose --version
docker-compose version 1.25.5, build unknown
It seems that docker-compose is still somewhere in the system, any ideas?
In case you did install it through apt, a
sudo apt remove docker-compose
would remove docker-compose from your system
I am trying to create a nfs-server using the below command:
docker run -d --rm --privileged --name nfs-server -v /var/folders/nfs:/var/nfs phico/nfs-server:latest
After this command when I check /var/folders I don't see nfs folder.
I logs I see the following :
Starting NFS server ...
Not starting NFS kernel daemon: no support in current kernel. ...
(warning).
NFS server started and listening on 172.17.0.2
Docker Preferences shows that docker has File Sharing Permissions for /var/folders
The logs from pod:
Can somebody help me out.
The issue with MacOS is not resolved but I believe similar solution exists in Mac. But on Ubuntu I had to install nfs-server and nfs-common for it to work.
sudo apt-get install nfs-common
sudo apt-get install nfs-server
You can follow the issue on the author's github page. The author was super helpful and figured out the solution.
I suddenly got the fatal error message from Docker yesterday. I really don't understand why as I shut down my machine properly. So I decided to uninstall docker and reinstall it. I went into the Applications folder in my Mac and I can't uninstall because it thinks the docker is open. So I need help with the following:
how do I uninstall docker?
how do I install it so it can start working again?
Attempts at a resolution:
Just tried the following command in my terminal:
docker kill $(docker ps -q)
I got the following response:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
"docker kill" requires at least 1 argument.
See 'docker kill --help'.
What do I do?
See the screen shot
This was getting me crazy.
You don't need to reinstall Docker to solve it. The workaround (at least in my case) is as simple as killing all Docker related processes and running Docker again:
$ pkill Docker
$ open -a /Applications/Docker.app
1- open Activity monitor and go to com.docker. process , from there you have to kill it to proceed further.
2- uninstall from mac is standard procedure.
In my case I was not able to use the Option of Rest and Diagnose too. UI was completely hung
Here's how I solved it.
Killed the docker process $ pkill Docker
Moved the docker application to bin
Manually deleted all the below files
sudo rm -rf /usr/local/lib/Docker
sudo rm -rf /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -rf /Library/LaunchDaemons/com.docker.vmnetd.plist
rm -rf ~/.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/Library/Application Support/Docker Desktop
rm -rf ~/Library/Preferences/com.docker.docker.plist
rm -rf ~/Library/Saved Application State/com.electron.docker-frontend.savedState
rm -rf ~/Library/Group Containers/group.com.docker
rm -rf ~/Library/Logs/Docker Desktop
rm -rf ~/Library/Preferences/com.electron.docker-frontend.plist
rm -rf ~/Library/Cookies/com.docker.docker.binarycookies
Restarted the laptop
Installed the latest version again which worked fine
Ok, I was able to fix this problem. You can do this with ANY application (just change the name), that you can't remove from the applications folder.
It will remove the entire application in its entirety. The existence of the application is wiped clean.
Please do the following commands in this order
ps aux | grep docker
When you run this command you get a big display. You are only interested in the following thing in the his screen grab
2 Then do a sudo kill command that includes the number in the red box from the ps aux|grep command as shown this code example in step 1.
sudo kill -9 108
Finally go to sudo remove command specifying the specific folder and application you want to remove.
sudo rm -rf /Applications/Docker.app/
Restart your machine.
Install version of docker. If the error occurred when updating to a new version of docker (such as in my case). You can download an older version of docker from here (the older version numbers are listed in the far left). I chose 3.3.0 (released 04/21 installed 6/11/21
Note:
If you have a problem installing an older version of docker and you encounter a problem
Run the following command and you will see a .json display
vi ~/Library/"Group Containers"/group.com.docker/settings.json
Scroll down to settings and modify the version down. For 3.3.0 I went down to setting version 7.
Restart docker and when it opens check images and you can see your containers
It worked for me when I opened the terminal and then ran this:
killall Docker && cd /Applications;open -a Docker;cd ~
I found it here: https://www.lewuathe.com/how-to-deal-with-failed-to-ping-backend-api-in-docker.html
I'm facing this error for docker version 3.6.0. then reinstall docker version 4.1.1 and it's working fine.
I recently upgraded Docker Desktop for Mac to version 2.2.0.0, and now when try to run a docker-machine command I am getting an error:
$ docker-machine --version
docker-machine: command not found
Docker Machine used to be installed with Docker, but it appears in the latest docs that this is no longer the case. What is the replacement or do I need to install Docker Machine from somewhere else?
Docker machine has been removed from later versions of Docker Desktop. Your going to need the docker-toolbox package.
Read here for install and co existence of the packages.
https://docs.docker.com/docker-for-mac/docker-toolbox/#docker-toolbox-and-docker-desktop-coexistence
For Windows, if you have chocolatey installed, you follow the steps:
open a command shell with "Run as Administrator" selected (I tested this on my work laptop).
run "choco install docker-machine"
Docker machine is now merged into the docker command, So instead of using
docker-machine init
Use
docker swarm init
And instead of
docker-machine join
Use
docker swarm join
for more command just use this:
docker swarm --help
If you already have docker-desktop & want the docker-machine command, then brew install docker-machine does the trick.
My versions of the binaries in usr/local/bin/docker and usr/local/bin/docker-compose did not change, & the version of the docker client & server, but I got the docker-machine binary extra.
run unset ${!DOCKER_*} if you want to use docker-desktop.
The docker docs are a bit confusing because they seem to address the case where you have docker-machine first, not the case where you have desktop first.
You basically need to install Docker Machine first on your local machine. Reference :- https://github.com/docker/machine/releases
$ curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
Try and run this command on bash:
curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
Click here to know more about docker-machine installation
It worked for me.
Did you try brew to install it as they removed docker-machine from v2.2.0?
brew install docker-machine
Try this (both inside, and outside of container):
ss -nputl
I created a ubuntu docker container and when I try to edit the sudoers file I get the following message.
root#8c8a8ff68234:~# sudo visudo
visudo: no editor found (editor path = /usr/bin/editor)
Create command and run command:-
docker run -id ubuntu
docker exec -ti 8c8a8ff68234 /bin/bash
You are already root, so no need to use sudo.
Also, you have not vim pre-installed in ubuntu base image. So you need to install it with apt-get install vim. Or in Dockerfile:
RUN apt-get install vim
That will set the editor properly. To use visudo
visudo