github.com/rkt/rkt@v1.30.1-0.20200224141603-171c416fac02/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 coreos.com/etcd 9 { 10 "acVersion": "0.8.11", 11 "acKind": "ImageManifest", 12 ... 13 ``` 14 15 ### Options 16 17 | Flag | Default | Options | Description | 18 | --- | --- | --- | --- | 19 | `--pretty-print` | `true` | `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 ### Image size 124 125 In rkt, dependencies between ACI images form a directed acyclic graph. 126 An image is pre-rendered in what is called the tree store. 127 A rendered image in the tree store contains a ready-to-execute filesystem tree with all the files of the image plus the relevant files of its dependencies as specified by the [appc spec][ace-fs]. 128 129 The size shown in `rkt image list` is the uncompressed size of the image itself **plus** the size of its related tree stores. 130 131 **Note**: There's currently a bug in the size calculation logic. rkt assumes there can only be one tree store per image but, if a dependency changes, there will be multiple different tree stores. This bug is tracked by [#2968][rkt-2968] 132 133 ### Options 134 135 | Flag | Default | Options | Description | 136 | --- | --- | --- | --- | 137 | `--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 | 138 | `--full` | `false` | `true` or `false` | Use long output format | 139 | `--no-legend` | `false` | `true` or `false` | Suppress a legend with the list | 140 | `--order` | `asc` | `asc` or `desc` | Choose the sorting order if at least one sort field is provided (`--sort`) | 141 | `--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 | 142 143 ## rkt image rm 144 145 Given multiple image IDs or image names you can remove them from the local store. 146 147 ``` 148 # rkt image rm sha512-a03f6bad952b coreos.com/etcd 149 rkt: successfully removed aci for image: "sha512-a03f6bad952bd548c2a57a5d2fbb46679aff697ccdacd6c62e1e1068d848a9d4" ("coreos.com/rkt/stage1") 150 rkt: successfully removed aci for image: "sha512-91e98d7f167905b69cce91b163963ccd6a8e1c4bd34eeb44415f0462e4647e27" ("coreos.com/etcd") 151 rkt: 2 image(s) successfully removed 152 ``` 153 154 ## rkt image verify 155 156 Given one or more image IDs or image names, verify will verify that their 157 ondisk checksum matches the value previously calculated on render. 158 159 ``` 160 # rkt image verify quay.io/coreos/etcd:v3.1.0 sha512-887890e697d9 161 successfully verified checksum for image: "quay.io/coreos/etcd:v3.1.0" ("sha512-e70ec975ce5327ea52c4a30cc4a951ecea55217a290e866e70888517964ba700") 162 successfully verified checksum for image: "sha512-887890e697d9" ("sha512-887890e697d9a0229eff22436def3c436cb4b18f72ac274c8c05427b39539307") 163 ``` 164 165 ## Global options 166 167 See the table with [global options in general commands documentation][global-options]. 168 169 170 [global-options]: ../commands.md#global-options 171 [ace-fs]: https://github.com/appc/spec/blob/v0.8.11/spec/ace.md#filesystem-setup 172 [rkt-2968]: https://github.com/rkt/rkt/issues/2968