Docker Permission Denied: Fix 'permission denied' error with Docker daemon socket
This error message indicates that the user running the command does not have the necessary permission to access the Docker daemon socket.
To fix this issue, try running the 'docker' command with 'sudo' or add the user to the 'docker' group.
Here are the steps to add a user to the 'docker' group:
-
Run the following command to add the user to the 'docker' group:
sudo usermod -aG docker
Replace '<username>' with the actual username of the user you want to add.
2. Log out and log back in for the changes to take effect.
3. Verify that the user has been added to the 'docker' group by running the following command:
groups
This should display a list of groups that the user belongs to, including the 'docker' group.
4. Now you should be able to run 'docker' commands without using 'sudo'.
docker ps
原文地址: https://www.cveoy.top/t/topic/o0jZ 著作权归作者所有。请勿转载和采集!