22 lines
726 B
Markdown
22 lines
726 B
Markdown
# Create a Docker Swarm
|
|
- docker swarm init --advertise-addr 49.13.21.211
|
|
|
|
### It generates:
|
|
- docker swarm join --token SWMTKN-1-0jq7vfbis4at10s0p0jynpeqd0r4g0f9zxyqwgebmh8nb86ddk-aro5jtssuk7qw8654j5669scz 49.13.21.211:2377
|
|
|
|
### To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
|
|
|
|
# Dowload Docker
|
|
curl https://get.docker.com | sh
|
|
|
|
# Send Docker Command to the Remote Server As a Docker Client
|
|
export DOCKER_HOST="ssh://root@49.13.21.211"
|
|
|
|
# Remove Node from Swarm
|
|
docker node rm <node-name>
|
|
|
|
# Create Services in Swarm
|
|
docker service create --name <service-name> <image-name>
|
|
|
|
# Running with docker compose
|
|
docker stack deploy --compose-file docker-compose.yaml phoenix-test |