Docker Community Forums

Share and learn in the Docker community.

Windows docker container volume backup


(Kj90) #1

Expected behavior

Take backup of windows docker container volume backup

Actual behavior

Not clear about how to take backup of volume. Found some commands in stack overflow. But they are not working in windows.

Information

I am very new to windows docker.
I am able to take backup (.tar) file of container image. Using “commit” and “save” command.
But not able to take backup of volume. Might be i am following some wrong steps.

I have gone through https://stackoverflow.com/questions/21597463/how-to-port-data-only-volumes-from-one-host-to-another site

And running command: docker run --volumes-from vol1demo -v c:\Target microsoft/nanoserver tar xvf c:\Backup\backup.tar vol1

Here my understanding is,

vol1demo: container name.
-v: Path of volume destination directory. Created in container while attaching volume.
microsoft/nanoserver: Container base OS image.
tar xvf c:\Backup\backup.tar: Directory “Backup” present in c: in Host machine.
vol1: Volume name attached to container vol1demo.

  • the output of:
    using Powershell on Windows
    Output:
    C:\Program Files\Docker\docker.exe: Error response from daemon: container 294ac4a0305593688930c2ec210e4212839b9b25e343a24a104baf68cf671f07 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {“ApplicationName”:"",“CommandLine”:“tar xvf c:\Backup\backup.tar vol1”,“User”:"",“WorkingDirectory”:“C:\”,“Environment”:{},“EmulateConsole”:false,“CreateStdInPipe”:true,“CreateStdOutPipe”:true,“CreateStdErrPipe”:true,“ConsoleSize”:[0,0]}.

Steps to reproduce the behavior

  1. …Run command: docker run --volumes-from vol1demo -v c:\Target microsoft/nanoserver tar xvf c:\Backup\backup.tar vol1
  2. … Get above output.

Please can anyone help here?