Troubleshooting in Docker

Troubleshooting frequently-occurring issues in Docker

If you have followed all the instructions in every chapter, you will definitely have a running app now. However, you should keep in mind that sometimes, not going by the book will make you learn better. So, if you have been giving it a try and trying out different things so far, you may face some issues and that is okay.

In this lesson, we will see the troubleshooting of frequently-occurring issues.

For system or compatibility issues, check out Docker system support.

Frequently-faced issues

Here, we will see the errors and associated troubleshooting.

Wrong build path

$ docker build .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /Users/venkateshachintalwar/Documents/Online_Projects/Dockerfile: no
such file or directory

If you are accidentally not in the directory where Dockerfile is located, Docker will throw an error. cd into the directory where Dockerfile is located and that should solve the error.

Permission issues

WARNING: Error loading config file: /home/user/.docker/config.json -
stat /home/user/.docker/config.json: permission denied

If you face this kind of permission issues, you should either run the command with sudo or do the following:

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

This will add the current user to the Docker group which gives the current user the entire super-user level access for Docker.

Port issues

$ docker run -p 5000:5000 flask_app:1.0
docker: Error response from daemon: driver failed programming external
...