Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to restart and remove Docker from Applications in Mac : Fatal Error failed to ping backend api

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:

  1. how do I uninstall docker?
  2. 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

enter image description here

like image 338
fypnlp Avatar asked Jun 10 '21 09:06

fypnlp


People also ask

How do I enable Docker daemon on Mac?

On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. You can also start the Docker daemon manually and configure it using flags. This can be useful for troubleshooting problems.

How do I stop Docker from running on my Mac?

If you're on a Mac and try this via Terminal: Use killall Dockerto quit Docker. Restart it in the Applications folder or with open /Applications/Docker.app.

Did restarting the machine help fix this Docker Server bug?

3 1 Thx, yes restarting the machine helped. Unfortunately it's a server and shouldn't be restarted too often, hope they'll fix the bug. As I have docker 1.7 – peter Jul 12 '15 at 9:34 I agree, this really is a workaround, not a full resolution. I will monitor that bug report. – VonC Jul 12 '15 at 9:36 1

How do I restart a docker container that is stuck?

On windows machine close Docker Desktop then stop Docker.Service from task manager. Then rerun Docker Desktop. – enumerator Jun 24 '21 at 8:56 Add a comment | 60 All the docker: start | restart | stop | rm --force | killcommands may not work if the container is stuck. You can always restart the docker daemon.

How to run Docker run-P 5000 from an external IP?

docker run -p 5000:5000 will forward from all interfaces in the main network namespace (or more accurately, the one where the Docker daemon is running) to the external IP in the container. You therefore need to listen on the external IP inside the container, and the easiest way to do that is by listening on all interfaces: 0.0.0.0.


Video Answer


3 Answers

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.

enter image description here

like image 75
Vinod Avatar answered Oct 18 '22 20:10

Vinod


This was getting me crazy.

enter image description here

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

like image 26
Juanan Avatar answered Oct 18 '22 18:10

Juanan


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.

  1. Killed the docker process $ pkill Docker
  2. Moved the docker application to bin
  3. 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
  4. Restarted the laptop
  5. Installed the latest version again which worked fine
like image 14
rkmourya Avatar answered Oct 18 '22 18:10

rkmourya