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 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?”.

  • Bamboo: More than one agent per EC2 elastic instance?
  • How do I keep a Docker container and a node application running on EC2?
  • Windows Powershell run as admin fails to understand it's admin when connecting
  • Docker (compose) send to daemon mode without restart
  • Docker Swarm Cluster: daemonize
  • How Can I Get Mitmproxy Docker to Work on Windows Bash?
  • 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}
    # Push the image to 'my_repo' in the organization 'my_team', with tag 'bamboo_build'
    docker push${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!

  • Ansible and restarting a docker service
  • Flow of registration between kafka and zookeeper
  • How to change a docker repository to automated build?
  • Docker Exits Before Completing Golang Project Build
  • Get List of Official Docker Images
  • gcc: command not found
  • 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.