1

I have run two Docker images:

docker run --name=data mydata docker run -p 8080:8080 --name=master --volumes-from=data -d mymaster

I need to have backups of the data container, just for security, and perhaps for a possible migration in the future.

Julen
  • 1,024
  • 1
  • 13
  • 29

1 Answers1

1

You can copy the data with the cp command (https://docs.docker.com/engine/reference/commandline/cp/ and the example is from this answer Copying files from host to Docker container)

docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt

You can get the name of your container with docker ps.

If you want to automate the whole thing, that's a chapter for itself.

Community
  • 1
  • 1
23tux
  • 14,104
  • 15
  • 88
  • 187