We are using 2017.1.5 (build 47175) on a our local TeamCity server and are using the latest teamcity-docker-agent for ubuntu.
When starting the teamcity-docker-agent we add:
-v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker
to make docker available inside the container.
When running an example gradle build executed within an docker container it fails to run /opt/buildagent/temp/agentTmp/docker-shell-script-3687474573035166736.shdue to permission problems.
Is anyone using docker inside the teamcity-docker-agent without these problems?
root@99decd9a0703:/# ll /opt/buildagent/temp/agentTmp/docker-shell-script-3687474573035166736.sh
-rw-r--r-- 1 root root 225 Oct 18 06:08 /opt/buildagent/temp/agentTmp/docker-shell-script-3687474573035166736.sh
Build log:
[06:08:17][Step 1/1] Starting: /bin/sh -c docker pull openjdk && docker run --rm -w /opt/buildagent/work/472d663c385d6aef -v /opt/buildagent/work/472d663c385d6aef:/opt/buildagent/work/472d663c385d6aef -v /opt/buildagent/temp/agentTmp:/opt/buildagent/temp/agentTmp -v /opt/buildagent/temp/buildTmp:/opt/buildagent/temp/buildTmp -v /opt/buildagent/system:/opt/buildagent/system -v /opt/buildagent/lib:/opt/buildagent/lib:ro -v /opt/buildagent/tools:/opt/buildagent/tools:ro -v /opt/buildagent/plugins:/opt/buildagent/plugins:ro --env-file /opt/buildagent/temp/agentTmp/docker-wrapper-3086677386325386164.env --entrypoint /bin/sh openjdk /opt/buildagent/temp/agentTmp/docker-shell-script-3687474573035166736.sh
[06:08:17][Step 1/1] in directory: /opt/buildagent/work/472d663c385d6aef
[06:08:17][Step 1/1] Using default tag: latest
[06:08:19][Step 1/1] latest: Pulling from library/openjdk
[06:08:19][Step 1/1] Digest: sha256:9745ed74401b23fb845b4eb7ae07ecb7dc2d40bece6bdb089975a20f76766401
[06:08:19][Step 1/1] Status: Image is up to date for openjdk:latest
[06:08:20][Step 1/1] /bin/sh: 0: Can't open /opt/buildagent/temp/agentTmp/docker-shell-script-3687474573035166736.sh
[06:08:20][Step 1/1] Process exited with code 127
[06:08:20][Step 1/1] Process exited with code 127
[06:08:20][Step 1/1] Step Gradle failed