github.com/blixtra/rkt@v0.8.1-0.20160204105720-ab0d1add1a43/Documentation/subcommands/image.md (about)

     1  # rkt image
     2  
     3  ## rkt image cat-manifest
     4  
     5  For debugging or inspection you may want to extract an ACI manifest to stdout.
     6  
     7  ```
     8  # rkt image cat-manifest --pretty-print coreos.com/etcd
     9  {
    10    "acVersion": "0.7.0",
    11    "acKind": "ImageManifest",
    12  ...
    13  ```
    14  
    15  ### Options
    16  
    17  | Flag | Default | Options | Description |
    18  | --- | --- | --- | --- |
    19  | `--pretty-print` |  `false` | `true` or `false` | Apply indent to format the output |
    20  
    21  ## rkt image export
    22  
    23  There are cases where you might want to export the ACI from the store to copy to another machine, file server, etc.
    24  
    25  ```
    26  # rkt image export coreos.com/etcd etcd.aci
    27  $ tar xvf etcd.aci
    28  ```
    29  
    30  NOTES:
    31  
    32  - A matching image must be fetched before doing this operation, rkt will not attempt to download an image first, this subcommand will incur no-network I/O.
    33  - The exported ACI file might be different than the original one because rkt image export always returns uncompressed ACIs.
    34  
    35  ### Options
    36  
    37  | Flag | Default | Options | Description |
    38  | --- | --- | --- | --- |
    39  | `--overwrite` |  `false` | `true` or `false` | Overwrite output ACI |
    40  
    41  ## rkt image extract/render
    42  
    43  For debugging or inspection you may want to extract an ACI to a directory on disk.
    44  There are a few different options depending on your use case but the basic command looks like this:
    45  
    46  ```
    47  # rkt image extract coreos.com/etcd etcd-extracted
    48  # find etcd-extracted
    49  etcd-extracted
    50  etcd-extracted/manifest
    51  etcd-extracted/rootfs
    52  etcd-extracted/rootfs/etcd
    53  etcd-extracted/rootfs/etcdctl
    54  ...
    55  ```
    56  
    57  NOTE: Like with rkt image export, a matching image must be fetched before doing this operation.
    58  
    59  Now there are some flags that can be added to this:
    60  
    61  To get just the rootfs use:
    62  
    63  ```
    64  # rkt image extract --rootfs-only coreos.com/etcd etcd-extracted
    65  # find etcd-extracted
    66  etcd-extracted
    67  etcd-extracted/etcd
    68  etcd-extracted/etcdctl
    69  ...
    70  ```
    71  
    72  If you want the image rendered as it would look ready-to-run inside of the rkt stage2 then use `rkt image render`.
    73  NOTE: this will not use overlayfs or any other mechanism.
    74  This is to simplify the cleanup: to remove the extracted files you can run a simple `rm -Rf`.
    75  
    76  ### Options
    77  
    78  | Flag | Default | Options | Description |
    79  | --- | --- | --- | --- |
    80  | `--overwrite` |  `false` | `true` or `false` | Overwrite output directory |
    81  | `--rootfs-only` |  `false` | `true` or `false` | Extract rootfs only |
    82  
    83  ## rkt image gc
    84  
    85  You can garbage collect the rkt store to clean up unused internal data and remove old images.
    86  
    87  By default, images not used in the last 24h will be removed.
    88  This can be configured with the `--grace-period` flag.
    89  
    90  ```
    91  # rkt image gc --grace-period 48h
    92  rkt: removed treestore "deps-sha512-219204dd54481154aec8f6eafc0f2064d973c8a2c0537eab827b7414f0a36248"
    93  rkt: removed treestore "deps-sha512-3f2a1ad0e9739d977278f0019b6d7d9024a10a2b1166f6c9fdc98f77a357856d"
    94  rkt: successfully removed aci for image: "sha512-e39d4089a224718c41e6bef4c1ac692a6c1832c8c69cf28123e1f205a9355444" ("coreos.com/rkt/stage1")
    95  rkt: successfully removed aci for image: "sha512-0648aa44a37a8200147d41d1a9eff0757d0ac113a22411f27e4e03cbd1e84d0d" ("coreos.com/etcd")
    96  rkt: 2 image(s) successfully removed
    97  ```
    98  
    99  ### Options
   100  
   101  | Flag | Default | Options | Description |
   102  | --- | --- | --- | --- |
   103  | `--grace-period` |  `24h0m0s` | A time | Duration to wait since an image was last used before removing it |
   104  
   105  ## rkt image list
   106  
   107  You can get a list of images in the local store with their keys, names and import times.
   108  
   109  ```
   110  # rkt image list
   111  ID                       NAME                            IMPORT TIME     LAST USED      SIZE    LATEST
   112  sha512-91e98d7f1679      coreos.com/etcd:v2.0.9          6 days ago      2 minutes ago  12MiB   false
   113  sha512-a03f6bad952b      coreos.com/rkt/stage1:0.7.0     55 minutes ago  2 minutes ago  143MiB  false
   114  ```
   115  
   116  A more detailed output can be had by adding the `--full` flag:
   117  
   118  ```
   119  ID                                                                        NAME                                         IMPORT TIME                          LAST USED                           SIZE       LATEST
   120  sha512-96323da393621d846c632e71551b77089ac0b004ceb5c2362be4f5ced2212db9   registry-1.docker.io/library/redis:latest    2015-12-14 12:30:33.652 +0100 CET    2015-12-14 12:33:40.812 +0100 CET   113309184  true
   121  ```
   122  
   123  ### Options
   124  
   125  | Flag | Default | Options | Description |
   126  | --- | --- | --- | --- |
   127  | `--fields` |  `id,name,importtime,lastused,size,latest` | A comma-separated list with one or more of `id`, `name`, `importtime`, `lastused`, `size`, `latest` | Comma-separated list of fields to display |
   128  | `--full` |  `false` | `true` or `false` | Use long output format |
   129  | `--no-legend` |  `false` | `true` or `false` | Supress a legend with the list |
   130  | `--order` |  `asc` | `asc` or `desc` | Choose the sorting order if at least one sort field is provided (`--sort`) |
   131  | `--sort` |  `importtime` | A comma-separated list with one or more of `id`, `name`, `importtime`, `lastused`, `size`, `latest` | Sort the output according to the provided comma-separated list of fields |
   132  
   133  ## rkt image rm
   134  
   135  Given an image ID or image name you can remove it from the local store.
   136  
   137  ```
   138  # rkt image rm sha512-a03f6bad952b coreos.com/etcd
   139  rkt: successfully removed aci for image: "sha512-a03f6bad952bd548c2a57a5d2fbb46679aff697ccdacd6c62e1e1068d848a9d4" ("coreos.com/rkt/stage1")
   140  rkt: successfully removed aci for image: "sha512-91e98d7f167905b69cce91b163963ccd6a8e1c4bd34eeb44415f0462e4647e27" ("coreos.com/etcd")
   141  rkt: 2 image(s) successfully removed
   142  ```
   143  
   144  ## Global options
   145  
   146  | Flag | Default | Options | Description |
   147  | --- | --- | --- | --- |
   148  | `--debug` |  `false` | `true` or `false` | Prints out more debug information to `stderr` |
   149  | `--dir` | `/var/lib/rkt` | A directory path | Path to the `rkt` data directory |
   150  | `--insecure-options` |  none | <ul><li>**none**: All security features are enabled</li><li>**http**: Allow HTTP connections. Be warned that this will send any credentials as clear text.</li><li>**image**: Disables verifying image signatures</li><li>**tls**: Accept any certificate from the server and any host name in that certificate</li><li>**ondisk**: Disables verifying the integrity of the on-disk, rendered image before running. This significantly speeds up start time.</li><li>**all**: Disables all security checks</li></ul>  | Comma-separated list of security features to disable |
   151  | `--local-config` |  `/etc/rkt` | A directory path | Path to the local configuration directory |
   152  | `--system-config` |  `/usr/lib/rkt` | A directory path | Path to the system configuration directory |
   153  | `--trust-keys-from-https` |  `false` | `true` or `false` | Automatically trust gpg keys fetched from https |
   154  | `--user-config` |  `` | A directory path | Path to the user configuration directory |