Docker --add-host flags not working for registry 2.0 webhooks notifications -
i had connect docker host (where application running @ 8080) within registry container. enable this, passed docker host's ip address container using "--add-host" flag. followed github issue , command line reference. enabled application endpoint:8080 in below config.yml send webhooks notifications registry.
this set working until yesterday application received kinds of push/pull event notifications in docker version 1.8.2. however, stopped working today. tried upgrading 1.8.2 1.8.3 see if fixes it, no luck far. not sure if related docker 1.9 release updates.
any inputs/suggestions/pointers appreciated.
docker version:
$ docker version client: 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 server: 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 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 this, configured send webhooks notification application endpoint:8080 (applistener):
version: 0.1 log: fields: service: registry storage: cache: blobdescriptor: inmemory filesystem: rootdirectory: /var/lib/registry http: addr: :5000 headers: x-content-type-options: [nosniff] health: storagedriver: enabled: true interval: 10s threshold: 3 notifications: endpoints: - name: applistener url: http://dockerhost:8080/event headers: authorization: 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 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 172.17.42.1:8080: connection refused, retrying"
thanks.
the problem seems application.properties file in maven application server.address specified 127.0.0.1.
server.address=127.0.0.1 server.port=8080
fixing below "server.address=dockerhost", same "--add-host=dockerhost:.." in docker run command fixed it.
server.address=dockerhost server.port=8080
Comments
Post a Comment