docker.pull

docker.pull

Pull a list of Docker images.

This method uses a custom docker-image script on the node if available. Otherwise, it falls back to the standard docker pull command. The script supports options like staging, pruning, and retries. The custom script is added to nodes with the profiles::docker or profiles::cluster profile and is at the following path: /opt/reliant/bin/docker-image.sh.

JSON-RPC Request

{"jsonrpc":"2.0","id":1,"method":"docker.pull","params":{"images":["string"]}}

Request Parameters

ArgumentTypeDescriptionRequiredDefault value
imagesString arrayThe Docker image names to pull.Yes-
strictBooleanIf true, only the custom docker-image.sh script is used. The method fails if the script is not available.Nofalse
verboseBooleanEnables verbose logging output. On the command line, use --no-verbose to turn it off.Notrue
pruneBooleanRemoves Docker images that are not in the images list after pulling.Nofalse
retriesIntegerThe number of pull attempts if a download fails.No3
max_waitIntegerThe maximum random wait time (jitter), in seconds, before the pull starts. On the command line, use --max-wait.No0
sleep_between_pullsIntegerThe wait time, in seconds, between pulling each image. On the command line, use --sleep-between-pulls.No10
stage_imagesBooleanWhether to download (stage) the images in the images list. The script checks each image, skips images that are already present and valid, and pulls the rest, retrying up to retries times. If false, no images are pulled, which is useful with prune to only remove images that are not in the list. Only applies when the docker-image.sh script is used. On the command line, use --no-stage-images to turn it off.Notrue
notify_uriStringA URI to which RVC sends progress messages for the pull, including a final message with its exit code. On the command line, use --notify-uri.Nonull

JSON-RPC Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "Pulling docker images..."
}

RVC CLI Example

rvc docker pull --images=redis:8.0.1-alpine,nginx:latest

Response

Pulling docker images...
[docker-image] Attempt 1
[docker-image] Starting image staging process
[docker-image] Checking image: nginx:latest
[docker-image] Image not found locally: nginx:latest, pulling fresh
[docker-image] Sleeping 5 seconds before pull
[docker-image] Pulling image: nginx:latest
latest: Pulling from library/nginx
119d43eec815: Already exists
700146c8ad64: Pulling fs layer
d989100b8a84: Pulling fs layer
500799c30424: Pulling fs layer
10b68cfefee1: Pulling fs layer
57f0dd1befe2: Pulling fs layer
eaf8753feae0: Pulling fs layer
10b68cfefee1: Waiting
57f0dd1befe2: Waiting
eaf8753feae0: Waiting
500799c30424: Verifying Checksum
500799c30424: Download complete
d989100b8a84: Verifying Checksum
d989100b8a84: Download complete
10b68cfefee1: Verifying Checksum
57f0dd1befe2: Verifying Checksum
10b68cfefee1: Download complete
57f0dd1befe2: Download complete
700146c8ad64: Verifying Checksum
700146c8ad64: Download complete
eaf8753feae0: Verifying Checksum
eaf8753feae0: Download complete
700146c8ad64: Pull complete
d989100b8a84: Pull complete
500799c30424: Pull complete
10b68cfefee1: Pull complete
57f0dd1befe2: Pull complete
eaf8753feae0: Pull complete
Digest: sha256:c881927c4077710ac4b1da63b83aa163937fb47457950c267d92f7e4dedf4aec
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
[docker-image] Checking image: redis:8.0.1-alpine
[docker-image] Image not found locally: redis:8.0.1-alpine, pulling fresh
[docker-image] Sleeping 5 seconds before pull
[docker-image] Pulling image: redis:8.0.1-alpine
8.0.1-alpine: Pulling from library/redis
f18232174bc9: Already exists
ae70cfa555e1: Already exists
459a05bebf96: Already exists
5f67a1bbf293: Already exists
d50c89ec5544: Already exists
4f4fb700ef54: Already exists
f89850c0c3d2: Already exists
Digest: sha256:62b5498c91778f738f0efbf0a6fd5b434011235a3e7b5f2ed4a2c0c63bb1c786
Status: Downloaded newer image for redis:8.0.1-alpine
docker.io/library/redis:8.0.1-alpine
[docker-image] No more images to download
[docker-image] Removing images
[docker-image] postgres:latest