docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.‘, Perm

Your error message shows that there was a problem trying to get the Docker server API version, specifically the connection was interrupted with a "Permission denied" permission error.

This could be because the Docker daemon is running, but your user does not have sufficient privileges to communicate with it. This is a common permission problem on Linux/Unix systems.

Here are some possible solutions:

  1. Use sudo : Preface your docker or docker-compose commands with sudo, eg sudo docker-compose up. This will run the command with root privileges. But this is not a best practice as it may introduce other security issues.

  2. Add the user to the docker group : On Unix/Linux systems, you can resolve permission issues by adding the user to the docker group. This allows your user to run docker commands as non-root users. You can do this by running:

    sudo usermod -aG docker $USER
    

    This adds the current user to the docker group. Once added, you may need to log out and back in, or restart your system, for the changes to take effect.

  3. Check if the Docker service is running : You can systemctl status dockercheck if the Docker service is running by running (may require sudo privileges). If not, you may need to enable it ( sudo systemctl start docker).

Overall, the error message indicates that you're trying to do something that requires special permissions that your user doesn't have. You'll need to elevate your privileges somehow, the most common ways to do this are using sudo as above or adding the user to the docker group.

Guess you like

Origin blog.csdn.net/m0_57236802/article/details/131642832