Docker Community Forums

Share and learn in the Docker community.

Remote deploy to swarm


(Fedebev) #1

Good morning,
I’m approaching docker swarm now and I’m having trouble finding some information.
My goal is to create a gitlab or travis deployment to my swarm cluster, I created my manager node with the docker swarm init command and created a docker registry as a service; as indicated in the official documentation.

Here is my very simple dockerfile

FROM node:9.5.0

ADD . .

RUN yarn install

CMD [ "yarn", "start" ]

and here my compose

version: '3'

services:
  healthcheck:
    image: <registry_url>:<registry_port>/healthcheck
    build: .

Launching the command

docker-compose push

from another not-swarm server in the work fine and my image is correctly uploaded to the registry.

So now I think I have to deploy my stack with something like this (remember that I am running the following command from another server)

export DOCKER_HOST=tcp://<my_manager_url>:<my_manager_port>
docker stack deploy --compose-file docker-compose.yml healthcheck

but the swarm server reject me and i don’t know witch is the right port.

I think it must be configured in some way but I have not found anything about it.

I’m on the right way? Could you suggest me the documentation I did not find?

Thanks in advance


(Eldeberde) #2

Hi, Are you exposing any port??

How are you trying to connect?