github.com/rkt/rkt@v1.30.1-0.20200224141603-171c416fac02/Documentation/image-fetching-behavior.md (about)

     1  # Image Fetching Behavior
     2  
     3  When fetching, rkt will try to avoid unnecessary network transfers: if an updated image is already in the local store there's no need to download it again.
     4  
     5  This behavior can be controlled with the `--pull-policy` flag.
     6  
     7  ## General Behavior
     8  
     9  The following table describes the meaning of the `--pull-policy` flag.
    10  
    11  This flag accepts one of three options:
    12  
    13  Option                    | Description
    14  ------------------------- | ---------------------------------------------------------------------------------------------------
    15  `new`                     | __Default behavior in run and prepare__ Check the store, and if the image is missing fetch from remote
    16  `update`                  | __Default behavior in fetch__ Attempt to fetch from remote, but if the remote image matches something in our store don't pull it
    17  `never`                   | Only check the store, and don't fetch from remote.
    18  
    19  ## Details
    20  
    21  Here we detail the actions taken by rkt when fetching from store and remote for each type of image argument.
    22  
    23  Fetch from   | Image argument     | Detailed behavior
    24  ------------ | ------------------ | --------------------------------------------------------------------------------------------
    25  store        | file://            | Use the specified file
    26  store        | http(s)://         | Check for the URL in the local store. If found, use the corresponding image.
    27  store        | docker://          | Check for the URL in the local store. If found, use the corresponding image.
    28  store        | image name         | Check local store. If found, use that image. If there's a file in the current directory named like the image name, use that file instead.
    29  remote       | file://            | Use the specified file
    30  remote       | http(s)://         | Search in the store if the URL is available. If it's available and the saved Cache-Control maxage > 0 determine if the image should be downloaded. If it's not expired use the image. Otherwise download (sending if available the saved ETag). If the download returns a `304 Not Modified` use the image already saved in the local store.
    31  remote       | docker://          | Fetch using docker2aci.
    32  remote       | image name         | Execute [discovery logic][discovery-logic]. If discovery is successful use the discovered URL doing the above `remote` http(s):// image case. If there's a file in the current directory named like the image name, use that file instead.
    33  
    34  
    35  [discovery-logic]: https://github.com/appc/spec/blob/master/spec/discovery.md#app-container-image-discovery