2022-12-16

Failed to ping backend API

Failed to ping backend API

The following Docker-related dialog may occur when you start your Mac PC.

Failed to ping backend API

The dialog contains three buttons:

  • Reset Docker to factory defaults
  • Diagnose & Feedback
  • Exit

However, no matter which button is pressed, the dialog does not disappear.

Solution

You can execute the following command to force the Docker process to restart and the dialog disappears.

$ killall Docker && cd /Applications;open -a Docker;cd ~

Register commands as alias

Since this phenomenon occurs frequently, it is convenient to register the command as alias in ~/.zshrc.

First, open the ~/.zshrc file.

$ vim ~/.zshrc

Add the following alias.

~/.zshrc
alias rdocker="killall Docker && cd /Applications;open -a Docker;cd ~"

Restart zsh or run the following command to read the ~/.zshrc file.

$ source ~/.zshrc

Now you can immediately force the Docker process to restart by executing the following command:

$ rdocker

References

https://www.lewuathe.com/how-to-deal-with-failed-to-ping-backend-api-in-docker.html
https://github.com/docker/for-mac/issues/5037

Ryusei Kakujo

researchgatelinkedingithub

Focusing on data science for mobility

Bench Press 100kg!