Answer the question
In order to leave comments, you need to log in
What is the best/correct way to set up automatic deployment of a Docker container on a Swarm cluster?
Good afternoon.
I'm setting up a test environment to automatically deploy containers on a cluster. There is a question how to configure correctly. The TeamCity agent collects the sources, tests, builds the container and puts it in the registry. Further a question how to lift it on a cluster?
Option 1. Using standard docker tools:
export DOCKER_HOST=swarm-master:4000
docker run -d -p 1234:1234 --name my_application --label my_application registry/my_application:${version}
export DOCKER_HOST=swarm-master:4000
docker-compose up my_application
restart: unless-stopped
labels:
com.docker.swarm.reschedule-policies: "[\"on-node-failure\"]"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question