Skip to content

docker

A set of docker tasks.

List of tasks

Tasks Description
docker:build-local Build an image locally: TAG|T=image:tag VERSION|V=1.2.3 [VCS_REF|C=110f273aad1cc] [FILE|F=Dockerfile] (*)
docker:build-push-multiarch Build and push a docker image: DOCKER_USER|U=username DOCKER_PASS|P=password TAG|T=image:tag VERSION|V=1.2.3 [REGISTRY|R=docker.io] [VCS_REF|C=110f273aad1cc] [FILE|F=Dockerfile] [ARCH|A=linux/amd64,linux/arm64] (*)
docker:count-layer Count number of layer of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 (*)
docker:get-base-image Get the base image of a Dockerfile: [FILE|F=Dockerfile] (*)
docker:get-digest Get the digest of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 (*)
docker:get-digest-layer-n Get the digest of the layer N of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 NUM|N=0 (*)
docker:get-next-tag-index Get the next index for a tag: IMG|I=index.docker.io/jfxs/alpine-task VERSION|V=1.2.3 (*)
docker:rm Remove all unused containers (*)
docker:rm-all Remove all Docker objects (*)
docker:rmi Remove all untagged images (*)

global variables

Variables Description Default value
DOCKER_RUN_OPTS Optional Docker options for docker run command -
IMAGE_QEMU Default Docker image for Quemu multiarch/qemu-user-static
IMAGE_SKOPEO Default Docker image for Skopeo quay.io/skopeo/stable

docker:build-local

Build an image locally: TAG|T=image:tag VERSION|V=1.2.3 [VCS_REF|C=110f273aad1cc] [FILE|F=Dockerfile] (*)

[DOCKER] Build an image locally.
Usage: task docker:build-local TAG|T=<image[:tag]> VERSION|V=<version> [VCS_REF|C=<commit_sha>] [FILE|F=<Dockerfile_path>]
Arguments Description
TAG | T Tag of the image (required)
VERSION | V Version (required)
VCS_REF | C Commit revision SHA hash (optional, by default NO_REF)
FILE | F Dockerfile path (optional, by default Dockerfile)

Requirements:

  • docker

docker:build-push-multiarch

Build and push a docker image: DOCKER_USER|U=username DOCKER_PASS|P=password TAG|T=image:tag VERSION|V=1.2.3 [REGISTRY|R=docker.io] [VCS_REF|C=110f273aad1cc] [FILE|F=Dockerfile] [ARCH|A=linux/amd64,linux/arm64] (*)

[DOCKER] Build and push a docker image.
Usage: task docker:build-push DOCKER_USER|U=<username> DOCKER_PASS|P=<password> TAG|T=<image[:tag]> VERSION|V=<version> [REGISTRY|R=<registry_url>] [VCS_REF|C=<commit_sha>] [FILE|F=<Dockerfile_path>] [ARCH|A=<architecture_list>]
Arguments Description
DOCKER_USER | U Registry user (required)
DOCKER_PASS | P Registry password/token (required)
TAG | T Tag of the image (required)
VERSION | V Version (required)
REGISTRY | R Registry URL (optional, by default docker.io)
VCS_REF | C Commit revision SHA hash (optional)
FILE | F Dockerfile path (optional, by default Dockerfile)
ARCH | A Build plateform (optional, by default linux/amd64,linux/arm64)

Requirements:

  • docker

docker:count-layer

Count number of layer of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 (*)

[DOCKER] Count number of layer of an image.
Usage: task docker:count-layer IMG|I=<image>
Arguments Description
IMG | I Image to analyze (required)

Requirements:

  • docker or skopeo

docker:get-base-image

Get the base image of a Dockerfile: [FILE|F=Dockerfile] (*)

[DOCKER] Get the base image of a Dockerfile.
Usage: task docker:get-digest [FILE|F=<Dockerfile_path>]
Arguments Description
FILE | F Dockerfile path (optional, by default Dockerfile)

Requirements:

Requirements:

  • None

docker:get-digest

Get the digest of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 (*)

[DOCKER] Get the digest of an image.
Usage: task docker:get-digest IMG|I=<image>
Arguments Description
IMG | I Image to analyze (required)

Requirements:

  • docker or skopeo

docker:get-digest-layer-n

Get the digest of the layer N of an image: IMG|I=index.docker.io/jfxs/alpine-task:3.19.0-001 NUM|N=0 (*)

[DOCKER] Get the digest of the layer N of an image.
Usage: task docker:get-digest-layer-n IMG|I=<image>
Arguments Description
IMG | I Image to analyze (required)
NUM | N Layer to get. Start at 0 (required)
  • docker or skopeo

Requirements:

  • None

docker:get-next-tag-index

Get the next index for a tag: IMG|I=index.docker.io/jfxs/alpine-task VERSION|V=1.2.3 (*)

[DOCKER] Get the next index.
Usage: task docker:get-next-tag-index IMG|I=<image> VERSION|V=<version>
Arguments Description
IMG | I Image to analyze (required)
VERSION | V Version (required)

Requirements:

  • docker or skopeo
  • jq

docker:rm

Remove all unused containers (*)

[DOCKER] Remove all unused containers.
Usage: task docker:rm
Arguments Description
- -

Requirements:

  • docker

docker:rm-all

Remove all Docker objects (*)

[DOCKER] Remove all Docker objectss.
Usage: task docker:rm-all
Arguments Description
- -

Requirements:

  • docker

docker:rmi

Remove all untagged images (*)

[DOCKER] Remove untagged images.
Usage: task docker:rmi
Arguments Description
- -

Requirements:

  • docker