Docker Swarm Container Deployment

Hey guys I m wanting to deploy a container from a template and I was thinking it prompt me for which host I would like it on but a not seeing that

Please see attachments:

any help would be appreciated,
Michael

This seems to be the default behaviour, I get the same. You should make a “feature request” for this.

Containers are always deployed to the host machine. If you want to spread containers around you have 3 options.

Make a service in a stack (i.e. docker-compose.yml file) and upload it. From there you can limit deployment to different nodes in the swarm with labels

deploy:
  endpoint_mode: dnsrr
  placement:
    constraints:
      - node.role == worker
      - node.hostname == mysql-node

The other options is to add more endpoints to your portainer dashboard. This allows you to speak directly to the docker daemon on another node and run the container there.

Run the portainer agent on all your nodes in your swarm (default behavior when starting from app templates). Then add endpoints and choose “agent” as the endpoint type.

Lastly you can expose the docker daemon on a TCP port on any node create another portainer endpoint that way. But you should be careful not to let the docker port 5000 on any public IP.

So, make a stack from a docker-compose.yml if you have a swarm. Install portainer agent if you have a swarm. Or securely expose dockerd over tcp if you don’t have a swarm.