github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/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  <!-- This file is maintained within the docker/cli GitHub
     8       repository at https://github.com/docker/cli/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # save
    17  
    18  ```markdown
    19  Usage:  docker save [OPTIONS] IMAGE [IMAGE...]
    20  
    21  Save one or more images to a tar archive (streamed to STDOUT by default)
    22  
    23  Options:
    24        --help            Print usage
    25    -o, --output string   Write to a file, instead of STDOUT
    26  ```
    27  
    28  ## Description
    29  
    30  Produces a tarred repository to the standard output stream.
    31  Contains all parent layers, and all tags + versions, or specified `repo:tag`, for
    32  each argument provided.
    33  
    34  ## Examples
    35  
    36  ### Create a backup that can then be used with `docker load`.
    37  
    38  ```bash
    39  $ docker save busybox > busybox.tar
    40  
    41  $ ls -sh busybox.tar
    42  
    43  2.7M busybox.tar
    44  
    45  $ docker save --output busybox.tar busybox
    46  
    47  $ ls -sh busybox.tar
    48  
    49  2.7M busybox.tar
    50  
    51  $ docker save -o fedora-all.tar fedora
    52  
    53  $ docker save -o fedora-latest.tar fedora:latest
    54  ```
    55  
    56  ### Cherry-pick particular tags
    57  
    58  You can even cherry-pick particular tags of an image repository.
    59  
    60  ```bash
    61  $ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
    62  ```