Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Post “docker-swarm-on-nixos/docker-swarm-on-nixos” #115

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update Post “docker-swarm-on-nixos/docker-swarm-on-nixos”
davidvasandani committed Aug 8, 2024
commit 202a2cec5912b7564f46724c7fac314a98c62d67
28 changes: 28 additions & 0 deletions posts/docker-swarm-on-nixos/docker-swarm-on-nixos.md
Original file line number Diff line number Diff line change
@@ -107,3 +107,31 @@ docker context create remote --docker "host=tcp://###.###.###.###:2375"
docker --context remote ps
docker context use remote
```

---

### Join a worker to the Swarm and scale a service

1. Join the Swarm from the worker device
```
docker swarm join --token XXX ###.###.###.###:2377

2. Create a Swarm Service
```
docker service create --replicas 1 --name helloworld alpine ping docker.com
```

3. Inspect
```
docker service inspect --pretty helloworld
```

4. Scale the service.
```
docker service scale helloworld=5
```

5. List the tasks
```
docker service ps helloworld
```