backup DTR cluster from a swarm service
555
Load UCP client bundle
Create Docker Secret containing password for backup user
echo "password" | docker secret create backuppass -
Schedule service
docker service create -d \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount source=dtrbackup,target=/tmp/backup \
--restart-condition=none \
--restart-delay=24h \
support/dtrbackup:2.7
version: '3.7'
services:
dtr:
deploy:
restart_policy:
condition: any
delay: 24h
placement:
constraints:
- node.role == worker
- node.labels.com.docker.ucp.collection.system == true
image: adamancini/dtrbackup:2.7
environment:
UCP_USER: admin
UCP_URL: ucp.test.mira.annarchy.net
secrets:
- source: backuppass
target: password
volumes:
- source: dtrbackup
target: /backup
type: volume
- source: /var/run/docker.sock
target: /var/run/docker.sock
type: bind
ucp:
deploy:
restart_policy:
condition: any
delay: 24h
placement:
constraints:
- node.role == manager
image: adamancini/ucpbackup:3.2
environment:
UCP_USER: admin
secrets:
- source: backuppass
target: password
volumes:
- source: ucpbackup
target: /backup
type: volume
- source: /var/run/docker.sock
target: /var/run/docker.sock
type: bind
volumes:
ucpbackup:
dtrbackup:
secrets:
backuppass:
external: true
Content type
Image
Digest
Size
25.2 MB
Last updated
almost 6 years ago
docker pull adamancini/dtrbackup