vivekyad4v
vivekyad4v

Reputation: 14893

Docker engine swarm mode | Alternative of "extra_hosts" used in compose

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 below command in docker engine swarm mode .

"docker service create ...."

Upvotes: 1

Views: 1244

Answers (1)

thanhpk
thanhpk

Reputation: 4297

It was not supported in docker 1.12 but is supported in docker 1.13 (#28031). You can archive the same thing as extra_hosts with --host

docker service create --host "mshost:10.4.12.31" --host "mongodb:10.250.12.35" --host "DEV-MONGODB:10.250.12.35"

docs

Upvotes: 2

Related Questions