Bamboo “cannot connect to Docker daemon”

My Bamboo build plan (running on an linux64 agent) has a stage to do a source code checkout from my GitHub repo, and then a stage to build an image with that Dockerfile, which looks like this:

set -o xtrace
set -o errexit
${bamboo_DOCKER_SIGNATURE} build ${bamboo_DOCKER_BUILD_EXTRAS} -t myname:${bamboo_buildNumber} -f Dockerfile .

The next stage I want is a script that pushes this image to my Docker registry (on Quay.io). The script I have so far is below, but the build fails with the error “Cannot connect to the Docker daemon. Is the docker daemon running on this host?”.

  • Docker (compose) send to daemon mode without restart
  • Docker daemon processes
  • Tips on getting docker to work without having to run `sudo docker -d` on Ubuntu 15.04
  • Access docker image through web server
  • Docker user authentication against LDAP over SSL
  • docker daemon not connecting
  • set -o xtrace
    set -o errexit
    
    # service docker start  # commented out b/c this did not solve the docker daemon issue
    
    # This is where the build fails:
    docker login -e="." -u=${bamboo.QUAY_ROBOT_name} -p=${bamboo.QUAY_ROBOT_token} quay.io
    
    # Push the image to 'my_repo' in the Quay.io organization 'my_team', with tag 'bamboo_build'
    docker push quay.io/my_team/my_repo:bamboo_build${bamboo_buildNumber}
    

    FWIW the same login command works as expected from my local command line. How can I remedy this? Also, using Bamboo’s built in Docker task does not work — it’s unable to login to the registry, but for some reason does not have the “docker daemon” issue. Thank you in advance for any help!

  • Automated pulling from gitolite repo within docker container
  • where should I put docker-compose.yml
  • Apt-get not working behind firewall even setting Fiddler as a tunnel
  • Protractor running in docker returns element not existing but in localhost does
  • Mesosphere inter-service communication using Marathon
  • Docker-Compose Multiple Local Environments
  • One Solution collect form web for “Bamboo “cannot connect to Docker daemon””

    The trick was to use the Bamboo variable ${bamboo_DOCKER_SIGNATURE} instead of docker. This variable says to use a specific host–i.e., docker -H <host address>.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.