Back to Rkt

Image Fetching Behavior

Documentation/image-fetching-behavior.md

1.30.02.5 KB
Original Source

Image Fetching Behavior

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.

This behavior can be controlled with the --pull-policy flag.

General Behavior

The following table describes the meaning of the --pull-policy flag.

This flag accepts one of three options:

OptionDescription
newDefault behavior in run and prepare Check the store, and if the image is missing fetch from remote
updateDefault behavior in fetch Attempt to fetch from remote, but if the remote image matches something in our store don't pull it
neverOnly check the store, and don't fetch from remote.

Details

Here we detail the actions taken by rkt when fetching from store and remote for each type of image argument.

Fetch fromImage argumentDetailed behavior
storefile://Use the specified file
storehttp(s)://Check for the URL in the local store. If found, use the corresponding image.
storedocker://Check for the URL in the local store. If found, use the corresponding image.
storeimage nameCheck 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.
remotefile://Use the specified file
remotehttp(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.
remotedocker://Fetch using docker2aci.
remoteimage nameExecute 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.