github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/docs/source/markdown/podman-container-restore.1.md (about)

     1  % podman-container-restore(1)
     2  
     3  ## NAME
     4  podman\-container\-restore - Restores one or more containers from a checkpoint
     5  
     6  ## SYNOPSIS
     7  **podman container restore** [*options*] *name* [...]
     8  
     9  ## DESCRIPTION
    10  **podman container restore** restores a container from a container checkpoint or
    11  checkpoint image. The *container IDs*, *image IDs* or *names* are used as input.
    12  
    13  ## OPTIONS
    14  #### **--all**, **-a**
    15  
    16  Restore all checkpointed *containers*.\
    17  The default is **false**.\
    18  *IMPORTANT: This OPTION does not need a container name or ID as input argument.*
    19  
    20  #### **--file-locks**
    21  
    22  Restore a *container* with file locks. This option is required to
    23  restore file locks from a checkpoint image. If the checkpoint image
    24  does not contain file locks, this option is ignored. Defaults to not
    25  restoring file locks.\
    26  The default is **false**.
    27  
    28  #### **--ignore-rootfs**
    29  
    30  If a *container* is restored from a checkpoint tar.gz file it is possible that it also contains all root file-system changes. With **--ignore-rootfs** it is possible to explicitly disable applying these root file-system changes to the restored *container*.\
    31  The default is **false**.\
    32  *IMPORTANT: This OPTION is only available in combination with __--import, -i__.*
    33  
    34  #### **--ignore-static-ip**
    35  
    36  If the *container* was started with **--ip** the restored *container* also tries to use that
    37  IP address and restore fails if that IP address is already in use. This can happen, if
    38  a *container* is restored multiple times from an exported checkpoint with **--name, -n**.
    39  
    40  Using **--ignore-static-ip** tells Podman to ignore the IP address if it was configured
    41  with **--ip** during *container* creation.
    42  
    43  The default is **false**.
    44  
    45  #### **--ignore-static-mac**
    46  
    47  If the *container* was started with **--mac-address** the restored *container* also
    48  tries to use that MAC address and restore fails if that MAC address is already
    49  in use. This can happen, if a *container* is restored multiple times from an
    50  exported checkpoint with **--name, -n**.
    51  
    52  Using **--ignore-static-mac** tells Podman to ignore the MAC address if it was
    53  configured with **--mac-address** during *container* creation.
    54  
    55  The default is **false**.
    56  
    57  #### **--ignore-volumes**
    58  
    59  This option must be used in combination with the **--import, -i** option.
    60  When restoring *containers* from a checkpoint tar.gz file with this option,
    61  the content of associated volumes will not be restored.\
    62  The default is **false**.
    63  
    64  #### **--import**, **-i**=*file*
    65  
    66  Import a checkpoint tar.gz file, which was exported by Podman. This can be used
    67  to import a checkpointed *container* from another host.\
    68  *IMPORTANT: This OPTION does not need a container name or ID as input argument.*
    69  
    70  During the import of a checkpoint file Podman will select the same container runtime
    71  which was used during checkpointing. This is especially important if a specific
    72  (non-default) container runtime was specified during container creation. Podman will
    73  also abort the restore if the container runtime specified during restore does
    74  not much the container runtime used for container creation.
    75  
    76  #### **--import-previous**=*file*
    77  
    78  Import a pre-checkpoint tar.gz file which was exported by Podman. This option
    79  must be used with **-i** or **--import**. It only works on `runc 1.0-rc3` or `higher`.
    80  *IMPORTANT: This OPTION is not supported on the remote client, including Mac and Windows (excluding WSL2) machines.*
    81  
    82  #### **--keep**, **-k**
    83  
    84  Keep all temporary log and statistics files created by `CRIU` during
    85  checkpointing as well as restoring. These files are not deleted if restoring
    86  fails for further debugging. If restoring succeeds these files are
    87  theoretically not needed, but if these files are needed Podman can keep the
    88  files for further analysis. This includes the checkpoint directory with all
    89  files created during checkpointing. The size required by the checkpoint
    90  directory is roughly the same as the amount of memory required by the
    91  processes in the checkpointed *container*.\
    92  Without the **--keep**, **-k** option the checkpoint will be consumed and cannot be used again.\
    93  The default is **false**.
    94  
    95  #### **--latest**, **-l**
    96  
    97  Instead of providing the *container ID* or *name*, use the last created *container*. If other tools than Podman are used to run *containers* such as `CRI-O`, the last started *container* could be from either tool.\
    98  The default is **false**.\
    99  *IMPORTANT: This OPTION is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines. This OPTION does not need a container name or ID as input argument.*
   100  
   101  #### **--name**, **-n**=*name*
   102  
   103  If a *container* is restored from a checkpoint tar.gz file it is possible to rename it with **--name, -n**. This way it is possible to restore a *container* from a checkpoint multiple times with different
   104  names.
   105  
   106  If the **--name, -n** option is used, Podman will not attempt to assign the same IP
   107  address to the *container* it was using before checkpointing as each IP address can only
   108  be used once and the restored *container* will have another IP address. This also means
   109  that **--name, -n** cannot be used in combination with **--tcp-established**.\
   110  *IMPORTANT: This OPTION is only available for a checkpoint image or in combination
   111  with __--import, -i__.*
   112  
   113  #### **--pod**=*name*
   114  
   115  Restore a container into the pod *name*. The destination pod for this restore
   116  has to have the same namespaces shared as the pod this container was checkpointed
   117  from (see **[podman pod create --share](podman-pod-create.1.md#--share)**).\
   118  *IMPORTANT: This OPTION is only available for a checkpoint image or in combination
   119  with __--import, -i__.*
   120  
   121  This option requires at least CRIU 3.16.
   122  
   123  #### **--print-stats**
   124  
   125  Print out statistics about restoring the container(s). The output is
   126  rendered in a JSON array and contains information about how much time different
   127  restore operations required. Many of the restore statistics are created
   128  by CRIU and just passed through to Podman. The following information is provided
   129  in the JSON array:
   130  
   131  - **podman_restore_duration**: Overall time (in microseconds) needed to restore
   132    all checkpoints.
   133  
   134  - **runtime_restore_duration**: Time (in microseconds) the container runtime
   135    needed to restore the checkpoint.
   136  
   137  - **forking_time**: Time (in microseconds) CRIU needed to create (fork) all
   138    processes in the restored container (measured by CRIU).
   139  
   140  - **restore_time**: Time (in microseconds) CRIU needed to restore all processes
   141    in the container (measured by CRIU).
   142  
   143  - **pages_restored**: Number of memory pages restored (measured by CRIU).
   144  
   145  The default is **false**.
   146  
   147  #### **--publish**, **-p**=*port*
   148  
   149  Replaces the ports that the *container* publishes, as configured during the
   150  initial *container* start, with a new set of port forwarding rules.
   151  
   152  For more details please see **[podman run --publish](podman-run.1.md#--publish)**.
   153  
   154  #### **--tcp-established**
   155  
   156  Restore a *container* with established TCP connections. If the checkpoint image
   157  contains established TCP connections, this option is required during restore.
   158  If the checkpoint image does not contain established TCP connections this
   159  option is ignored. Defaults to not restoring *containers* with established TCP
   160  connections.\
   161  The default is **false**.
   162  
   163  ## EXAMPLE
   164  Restores the container "mywebserver".
   165  ```
   166  # podman container restore mywebserver
   167  ```
   168  
   169  Import a checkpoint file and a pre-checkpoint file.
   170  ```
   171  # podman container restore --import-previous pre-checkpoint.tar.gz --import checkpoint.tar.gz
   172  ```
   173  
   174  Start the container "mywebserver". Make a checkpoint of the container and export it. Restore the container with other port ranges from the exported file.
   175  ```
   176  $ podman run --rm -p 2345:80 -d webserver
   177  # podman container checkpoint -l --export=dump.tar
   178  # podman container restore -p 5432:8080 --import=dump.tar
   179  ```
   180  
   181  Start a container with the name "foobar-1". Create a checkpoint image "foobar-checkpoint". Restore the container from the checkpoint image with a different name.
   182  ```
   183  # podman run --name foobar-1 -d webserver
   184  # podman container checkpoint --create-image foobar-checkpoint foobar-1
   185  # podman inspect foobar-checkpoint
   186  # podman container restore --name foobar-2 foobar-checkpoint
   187  # podman container restore --name foobar-3 foobar-checkpoint
   188  ```
   189  
   190  ## SEE ALSO
   191  **[podman(1)](podman.1.md)**, **[podman-container-checkpoint(1)](podman-container-checkpoint.1.md)**, **[podman-run(1)](podman-run.1.md)**, **[podman-pod-create(1)](podman-pod-create.1.md)**, **criu(8)**
   192  
   193  ## HISTORY
   194  September 2018, Originally compiled by Adrian Reber <areber@redhat.com>