github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/save.md (about)

     1  ---
     2  title: "save"
     3  description: "The save command description and usage"
     4  keywords: "tarred, repository, backup"
     5  ---
     6  
     7  # save
     8  
     9  ```markdown
    10  Usage:  docker save [OPTIONS] IMAGE [IMAGE...]
    11  
    12  Save one or more images to a tar archive (streamed to STDOUT by default)
    13  
    14  Options:
    15        --help            Print usage
    16    -o, --output string   Write to a file, instead of STDOUT
    17  ```
    18  
    19  ## Description
    20  
    21  Produces a tarred repository to the standard output stream.
    22  Contains all parent layers, and all tags + versions, or specified `repo:tag`, for
    23  each argument provided.
    24  
    25  ## Examples
    26  
    27  ### Create a backup that can then be used with `docker load`.
    28  
    29  ```bash
    30  $ docker save busybox > busybox.tar
    31  
    32  $ ls -sh busybox.tar
    33  
    34  2.7M busybox.tar
    35  
    36  $ docker save --output busybox.tar busybox
    37  
    38  $ ls -sh busybox.tar
    39  
    40  2.7M busybox.tar
    41  
    42  $ docker save -o fedora-all.tar fedora
    43  
    44  $ docker save -o fedora-latest.tar fedora:latest
    45  ```
    46  
    47  ### Save an image to a tar.gz file using gzip
    48  
    49  You can use gzip to save the image file and make the backup smaller.
    50  
    51  ```bash
    52  docker save myimage:latest | gzip > myimage_latest.tar.gz
    53  ```
    54  
    55  ### Cherry-pick particular tags
    56  
    57  You can even cherry-pick particular tags of an image repository.
    58  
    59  ```bash
    60  $ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
    61  ```