when use portainer to create service,i can not set hosts,
in create web page,have no hosts item
Host network is not available at the moment for Swarm services (this is a Docker limitation).
It should be available in Docker 17.06 version (not released yet), see: https://github.com/moby/moby/pull/32981
Portainer should automatically load and display that network when using 17.06, please re-open if you have issues once the version is out.
in 17.05 docker service create can use --host mysqlhost:10.0.0.2 to add mysqlhost to /etc/hosts,17.05 is released
Ah indeed, you're looking at adding Host file entries (like in the container-creation view). Sorry, I'll tag this as an enhancement then.
Most helpful comment
Ah indeed, you're looking at adding Host file entries (like in the container-creation view). Sorry, I'll tag this as an enhancement then.