Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker compose "extra_hosts" alternative in docker engine swarm mode #27902

Closed
viveky4d4v opened this issue Oct 31, 2016 · 12 comments · Fixed by #28031
Closed

docker compose "extra_hosts" alternative in docker engine swarm mode #27902

viveky4d4v opened this issue Oct 31, 2016 · 12 comments · Fixed by #28031

Comments

@viveky4d4v
Copy link

In docker compose file i was able to declare a domain & IP like below -

extra_hosts:
  - "mshost:10.4.12.31"
  - "mongodb DEV-MONGODB:10.250.12.35"

I want to know the alternative to this while using command in docker engine swarm mode .

 "docker service create ...."
@aluzzardi
Copy link
Member

/cc @dnephin @icecrime @mrjana

Do we want to add this into the ContainerSpec? (that's --add-host)

@dnephin
Copy link
Member

dnephin commented Nov 1, 2016

If it works, I guess it doesn't hurt to add it?

@yongtang
Copy link
Member

yongtang commented Nov 2, 2016

This is loosely related to #27567.

@icecrime
Copy link
Contributor

icecrime commented Nov 2, 2016

Makes sense to me. (Cc @vdemeester)

@vdemeester
Copy link
Member

Make sence to me too 👼

@yongtang
Copy link
Member

yongtang commented Nov 2, 2016

I can work on this issue once #27567 is merged in.

@yongtang
Copy link
Member

yongtang commented Nov 2, 2016

#dibs

yongtang added a commit to yongtang/swarmkit that referenced this issue Nov 3, 2016
This fix add a `ExtraHosts` field to DNS settings (`DNSConfig`)
so that additional records could be added for `/etc/hosts`.

This fix is related to docker issue:
moby/moby#27902

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
yongtang added a commit to yongtang/swarmkit that referenced this issue Nov 3, 2016
This fix add a `ExtraHosts` field to DNS settings (`DNSConfig`)
so that additional records could be added for `/etc/hosts`.

This fix is related to docker issue:
moby/moby#27902

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
yongtang added a commit to yongtang/swarmkit that referenced this issue Nov 3, 2016
This fix add a `ExtraHosts` field to DNS settings (`DNSConfig`)
so that additional records could be added for `/etc/hosts`.

This fix is related to docker issue:
moby/moby#27902

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang
Copy link
Member

yongtang commented Nov 3, 2016

Added a PR #28031. The flag --add-host conforms todocker runthough other suggestions are welcomed. No flag has been added todocker service updateyet (not sure about-add/-rm` case).

yongtang added a commit to yongtang/swarmkit that referenced this issue Nov 3, 2016
This fix add a `ExtraHosts` field to DNS settings (`DNSConfig`)
so that additional records could be added for `/etc/hosts`.

This fix is related to docker issue:
moby/moby#27902

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
yongtang added a commit to yongtang/swarmkit that referenced this issue Nov 4, 2016
This fix add a `ExtraHosts` field to DNS settings (`DNSConfig`)
so that additional records could be added for `/etc/hosts`.

This fix is related to docker issue:
moby/moby#27902

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@dtmistry
Copy link

Is this feature available in 1.13.0-rc1 ?

@yongtang
Copy link
Member

@dtmistry The PR has been merged in. You could use docker service create --host to specify additional extra hosts in 1.13.0-rc1.

@dtmistry
Copy link

@yongtang Thanks. I did not see this issue referenced in the 1.13.0-rc1 release notes. So just wanted to make sure.

@thaJeztah
Copy link
Member

@dtmistry you're right, it was missing in the changelog. I'm working on updates to the changelog for changes we missed, so I'll add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants