How to map docker.sock to docker container in Execute Commands (OD-2308)
Tomas Ptacek opened 10 months ago

Hi, for the agent itself, i can map docker.sock to the agent so it has docker available like so:

docker run -t -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/agent/work:/agent/work -e serverUrl=http://myserver -e agentToken=mytoken -h myagent 1dev/agent

How can I do the same for the Execute Commands step of a job that is using docker container to run? i need to run docker build and docker publish in one of my steps and I prefer using the Execute Commands rather than the built in Image steps. currently my job is failing on:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

thanks

  • Robin Shen commented 10 months ago

    To use docker inside command step. Make sure to enable the option mount docker sock under privilege settings section of relevant job executor. Job executor can be configured via side bar menu Administration / Job Executors.

  • Tomas Ptacek commented 10 months ago

    Thank you, couldn't find it.

  • Robin Shen commented 10 months ago

    You will need to use remote docker executor instead of remote shell executor.

  • Robin Shen changed state to 'Closed' 10 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2308
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover