1

docker networking seems not working, docker supposed to know the address and port when specifying the container name, or what am I missing?

Would it be possible to get the generated ip port like:

docker-compose.yml

command: nsqd 
         --auth-http-address='host:docker inspect -f '{{(index 
         (index .NetworkSettings.Ports "80/tcp") 0).HostPort}}' some-image'

tried changing the --auth-http-address='0.0.0.0:80' for local address Im running it locally.

docker-compose.yml

services:
  service1:
    image: image_name
    command: nsqd --auth-http-address='authenticator'
  authenticator:
    image: some_image
    command: some server.py
    ports: - "80"
    container_name: authenticator

Had error message

Error: failed auth against authenticator address authenticator: missing port in address

swoopy
  • 99
  • 12

1 Answers1

0

The error says it is expecting port number too. Change the command in docker-compose.yml to

 services:
  service1:
    image: image_name
    command: nsqd --auth-http-address=authenticator:80
asolanki
  • 1,096
  • 9
  • 17