- Issue type:
Rights to run Docker
- OS Version/build
NAME=“Red Hat Enterprise Linux Server”
VERSION=“7.5 (Maipo)”
ID=“rhel”
ID_LIKE=“fedora”
VARIANT=“Server”
VARIANT_ID=“server”
VERSION_ID=“7.5”
- App version
Docker version 19.03.3, build cde21d3829
- Steps to reproduce
Run build from ADO
I am running my Azure DevOps build agent with an account named “account”.
server:Linux:account: /opt/ADOReleaseMark → docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:
- The Docker client contacted the Docker daemon.
- The Docker daemon pulled the “hello-world” image from the Docker Hub.
(amd64)- The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.- The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/For more examples and ideas, visit:
Get started | Docker Docs
This works as intended. However when I run from a pipeline, I get the following error
docker run hello-world
========================== Starting Command Output ===========================
[command]/usr/bin/bash --noprofile --norc /opt/ADOReleaseMark/_work/_temp/cd98490e-3bcf-480c-a023-bca65cc4fbfb.sh
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.
##[error]Bash exited with code ‘126’.
The account is an AD account and not a local account. Running usermod -a -G docker account gives me the following error.
usermod: user ‘account’ does not exist
So to get around this I hard coded account into the group file. This allowed me to run docker hello, however I still get the same error when running from Azure DevOps.
Any thoughts on how I can allow anyone to call docker?
TIA,