mirror of https://github.com/docker/docs.git
Added examples (#8599)
* Added examples Added examples with more detail and automation to help customers backup DTR without creating support tickets. * Linked to explanation of example command @omegamormegil I removed the example with prepopulated fields, as I think it doesn't add much, and will only add confusion. Users who need this much detail can run the basic command and follow the terminal prompts. We can re-add in a follow-up PR, if you think that example is crucial to this page.
This commit is contained in:
parent
0f17dc7f34
commit
b20c134232
|
@ -15,12 +15,37 @@ docker run -i --rm docker/dtr \
|
|||
backup [command options] > backup.tar
|
||||
```
|
||||
|
||||
### Example Usage
|
||||
### Example Commands
|
||||
|
||||
#### Basic
|
||||
```bash
|
||||
docker run -i --rm docker/dtr \
|
||||
docker run -i --rm --log-driver none docker/dtr:{{ page.dtr_version }} \
|
||||
backup --ucp-ca "$(cat ca.pem)" --existing-replica-id 5eb9459a7832 > backup.tar
|
||||
```
|
||||
|
||||
### Advanced (with chained commands)
|
||||
```bash
|
||||
DTR_VERSION=$(docker container inspect $(docker container ps -f \
|
||||
name=dtr-registry -q) | grep -m1 -Po '(?<=DTR_VERSION=)\d.\d.\d'); \
|
||||
REPLICA_ID=$(docker ps --filter name=dtr-rethinkdb \
|
||||
--format "{{ .Names }}" | head -1 | sed 's|.*/||' | sed 's/dtr-rethinkdb-//'); \
|
||||
read -p 'ucp-url (The UCP URL including domain and port): ' UCP_URL; \
|
||||
read -p 'ucp-username (The UCP administrator username): ' UCP_ADMIN; \
|
||||
read -sp 'ucp password: ' UCP_PASSWORD; \
|
||||
docker run --log-driver none -i --rm \
|
||||
--env UCP_PASSWORD=$UCP_PASSWORD \
|
||||
docker/dtr:$DTR_VERSION backup \
|
||||
--ucp-username $UCP_ADMIN \
|
||||
--ucp-url $UCP_URL \
|
||||
--ucp-ca "$(curl https://${UCP_URL}/ca)" \
|
||||
--existing-replica-id $REPLICA_ID > \
|
||||
dtr-metadata-${DTR_VERSION}-backup-$(date +%Y%m%d-%H_%M_%S).tar
|
||||
```
|
||||
|
||||
For a detailed explanation on the advanced example, see
|
||||
[Back up your DTR metadata](ee/dtr/admin/disaster-recovery/create-a-backup/#back-up-dtr-metadata).
|
||||
To learn more about the `--log-driver` option for `docker run`, see [docker run reference](/engine/reference/run/#logging-drivers---log-driver).
|
||||
|
||||
## Description
|
||||
|
||||
This command creates a `tar` file with the contents of the volumes used by
|
||||
|
|
Loading…
Reference in New Issue