Docker –add-host flags not working for registry 2.0 webhooks notifications

I had to connect to the Docker host (where my application is running at 8080) from within my registry container. To enable this, i passed the Docker host’s IP Address to the container using the “–add-host” flag. Followed the github issue and Command line reference. I enabled my application endpoint:8080 in below config.yml to send webhooks notifications from registry.

This set up was working until yesterday where my application received all kinds of push/pull event notifications in docker version 1.8.2. However, it stopped working today. I tried upgrading from 1.8.2 to 1.8.3 to see if that fixes it, but no luck so far. Not sure if this is related to any Docker 1.9 release updates.

  • Docker, how to get container information from within the container?
  • Reverse proxy nginx and Express server returning 502
  • Run a database migration command when deploying a Docker container to AWS
  • docker compose: rebuild of one linked container breaks nginx's upstream
  • I keep getting “bsdtar: Failed to set file flags” when I try do pull base
  • Concurrency error while executing DocumentDB stored procedure on multiple Docker containers
  • Any inputs/suggestions/pointers would be much appreciated.

    Docker version:

    $ docker version
     Version:      1.8.3
     API version:  1.20
     Go version:   go1.4.2
     Git commit:   f4bf5c7
     Built:        Mon Oct 12 06:06:01 UTC 2015
     OS/Arch:      linux/amd64
     Version:      1.8.3
     API version:  1.20
     Go version:   go1.4.2
     Git commit:   f4bf5c7
     Built:        Mon Oct 12 06:06:01 UTC 2015
     OS/Arch:      linux/amd64

    Launching registry container with this command

    $docker run -d -p 5000:5000 --restart=always --add-host=dockerhost:$(ip route | awk '/docker0/ { print $NF }') --name docker_registry -v ~/docker-registry/images:/var/lib/registry -v ~/docker-registry/config/config.yml:/etc/docker/registry/config.yml registry:2.1.1

    config.yml looks like this, configured to send webhooks notification to my application endpoint:8080 (appListener):

    version: 0.1
        service: registry
        blobdescriptor: inmemory
        rootdirectory: /var/lib/registry
      addr: :5000
        X-Content-Type-Options: [nosniff]
        enabled: true
        interval: 10s
        threshold: 3
        - name: appListener
          url: http://dockerhost:8080/event
          timeout: 500ms
          threshold: 5
          backoff: 1s

    Error Logs in docker_registry:

    time="2015-10-30T23:50:15Z" level=warning msg="httpSink{http://dockerhost:8080/event} encountered too many errors, backing off"
    time="2015-10-30T23:50:16Z" level=error msg="retryingsink: error writing events: httpSink{http://dockerhost:8080/event}: error posting: Post http://dockerhost:8080/event: dial tcp connection refused, retrying"


  • using a maven docker plugin to commit and save an image on maven release
  • AWS ElasticBeanstalk can't find Dockerfile
  • How do I run a docker container based on its name from `docker ps -a`?
  • Any hook for Docker killed by out of memory
  • Finding Containers Using Docker VirtualBox
  • Should I created three images for Apache http server, php and memcached separately?
  • One Solution collect form web for “Docker –add-host flags not working for registry 2.0 webhooks notifications”

    The problem seems to be with file in maven application where server.address was specified as


    Fixing that to below “server.address=dockerhost”, same as “–add-host=dockerhost:..” in docker run command fixed it.

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