Docker Run Without Sudo command | Got permission denied issue

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post %2Fvar%2Frun%2Fdocker.sock/v1.35/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'.
    Run below command:
    Create the docker group if it does not exist
    $ sudo groupadd docker
    Add your user to the docker group.
    $ sudo usermod -aG docker $USER
    Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
    $ newgrp docker
    Check if docker can be run without root
    $ docker run hello-world
    Credits: stackoverflow....

КОМЕНТАРІ • 1