2
votes

having some issues with this and need a little help (guidance). The data I want to backup is located here: /var/lib/docker/volumes/eb5294b586d6537c965bde61d02da06d49ff77467afdc55ec1441413fe5fb128/_data

so I need to create a backup of this volume data and transfer it to another host. From this website https://docs.docker.com/engine/tutorials/dockervolumes/#creating-and-mounting-a-data-volume-container it says to use the following command: $ docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata

What is the "ubuntu" for? I am running on Ubuntu but in the explanation of the command, it doesn't say anything about it. Is it something that is optional? What about the /backup directory, where is that created? In the Home directory of the logged in user?

Thanks, Don

2
So after having a conversation with the new Host folks, it seems a DB dump is the way to go since the postgreSQL versions are different (9.5 vs 9.6). Can I save the dump file to the pgsql data directory nd recover that from the host since the docker volume is located on the host (I am assuming this is a mount point from the host to the container, or vice versa?)? - Don Mangiarelli

2 Answers

2
votes

What is the "ubuntu" for?

It's the base image that contains the tar utility.

I am running on Ubuntu but in the explanation of the command, it doesn't say anything about it. Is it something that is optional?

You need any docker image, which must have the tar command. It is not optional, you must provide the base image that a container will run on. (In your case you are running a one-off container: tar)

What about the /backup directory, where is that created? In the Home directory of the logged in user?

That is a mapped volume:

-v $(pwd):/backup

$(pwd) is your current working directory (which you run the docker command), mapped to the /backup/ dir in the container, where the tar command is instructed to deposit your backup file (backup.tar). So that file will appear where you run the docker command.

0
votes

The "ubuntu" in the context of the command "docker run ..." stands for the name of the image. It seems like the image being built is the standard ubuntu image.

See this example:

docker run -it ubuntu

https://hub.docker.com/_/ubuntu/