Skip to main content
Notice removed Draw attention by TuringTux
Bounty Ended with Mark R.'s answer chosen by TuringTux
Tweeted twitter.com/ServerFault/status/1351816742725672960
Notice added Draw attention by TuringTux
Bounty Started worth 50 reputation by TuringTux
added 21 characters in body
Source Link
Kolyunya
  • 237
  • 2
  • 3
  • 10

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one mustshould must not modify volumes under no circumstanceunder no circumstance. And restoring a volume manually into the /var/lib/docker/volumes/ violates that warning. So these two statements seem to be contradictory to me.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one must not modify volumes under no circumstance. And restoring a volume manually into the /var/lib/docker/volumes/ violates that warning. So these two statements seem to be contradictory to me.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one should must not modify volumes under no circumstance. And restoring a volume manually into the /var/lib/docker/volumes/ violates that warning. So these two statements seem to be contradictory to me.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?
added 147 characters in body
Source Link
Kolyunya
  • 237
  • 2
  • 3
  • 10

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one must not modify volumes under no circumstance. And restoring a volume manually into the /var/lib/docker/volumes/ violates that warning. So these two statements seem to be contradictory to me.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one must not modify volumes under no circumstance.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one must not modify volumes under no circumstance. And restoring a volume manually into the /var/lib/docker/volumes/ violates that warning. So these two statements seem to be contradictory to me.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?
Source Link
Kolyunya
  • 237
  • 2
  • 3
  • 10

Backing up volumes from host vs from the inside of the container

The official docker documentation suggests as a good practice to backup the entire docker volume as it is.

When you need to back up, restore, or migrate data from one Docker host to another, volumes are a better choice. You can stop containers using the volume, then back up the volume’s directory (such as /var/lib/docker/volumes/).

At the same time the docs state that one must not modify volumes under no circumstance.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem.

Questions:

  • Is it really safe to backup and restore volumes in that fashion between different versions of docker runtime?
  • Do volumes have some inner structure that is dependent on the runtime version? Or are they just regular files?
  • Is it safer to mount the volume to some container and backup it's data from the inside of the container?