Use Advanced Docker Operations with Artifactory CLI

Advanced Docker operations using JFrog CLI's Artifactory commands (jf rt). These commands are separate from the main jf docker command and provide integration with alternative container tools (Podman, Kaniko, buildx, OpenShift) and Docker image lifecycle management (build-docker-create, docker-promote).

This topic covers the following tasks:

Deprecation notice: The jf rt docker-push and jf rt docker-pull commands are deprecated. Use jf docker push and jf docker pull instead. The deprecated commands are hidden from --help output but still functional for backwards compatibility.


Pulling Docker Images Using Podman

Podman is a daemon-less container engine for developing, managing, and running OCI Containers. The podman-pull command pulls docker images from Artifactory using Podman, while collecting build-info.

To pull Docker images using Podman:

ParameterDescription
Command-namert podman-pull
Abbreviationrt ppl
--server-id[Optional] Server ID configured using jf config
--build-name[Optional] Build name
--build-number[Optional] Build number
--project[Optional] JFrog project key
--module[Optional] Module name for build-info
--skip-login[Default: false] Skip Docker login
Image tagThe docker image tag to pull
Source repositorySource repository in Artifactory

Example

jf rt podman-pull <registry>/<image>:<tag> <source-repo> --build-name <build-name> --build-number <build-number>

Where:

  • <registry> is your Artifactory Docker registry (e.g., my-docker-registry.io)
  • <image>:<tag> is the Docker image name and tag (e.g., my-docker-image:latest)
  • <source-repo> is the source repository in Artifactory (e.g., docker-local)

For example:

jf rt podman-pull my-docker-registry.io/my-docker-image:latest docker-local --build-name my-build-name --build-number 7

Pushing Docker Images Using Podman

After building your image, the podman-push command pushes the image layers to Artifactory, while collecting build-info.

To push Docker images using Podman:

ParameterDescription
Command-namert podman-push
Abbreviationrt pp
--server-id[Optional] Server ID configured using jf config
--build-name[Optional] Build name
--build-number[Optional] Build number
--project[Optional] JFrog project key
--module[Optional] Module name for build-info
--skip-login[Default: false] Skip Docker login
--threads[Default: 3] Number of working threads
--detailed-summary[Default: false] Include affected files in the command summary
Image tagThe docker image tag to push
Target repositoryTarget repository in Artifactory

Example

jf rt podman-push <registry>/<image>:<tag> <target-repo> --build-name=<build-name> --build-number=<build-number>

Where:

  • <registry>/<image>:<tag> is the full image reference (e.g., my-docker-registry.io/my-docker-image:latest)
  • <target-repo> is the target repository in Artifactory (e.g., docker-local)

For example:

jf rt podman-push my-docker-registry.io/my-docker-image:latest docker-local --build-name=my-build-name --build-number=7

Pushing Docker Images Using Kaniko

JFrog CLI allows pushing containers to Artifactory using Kaniko, while collecting build-info and storing it in Artifactory.

For detailed instructions, refer to the Kaniko project example on GitHub.

Pushing Docker Images Using buildx

JFrog CLI allows pushing containers to Artifactory using buildx, while collecting build-info and storing it in Artifactory.

For detailed instructions, refer to the buildx project example on GitHub.

Pushing Docker Images Using the OpenShift CLI

JFrog CLI allows pushing containers to Artifactory using the OpenShift CLI, while collecting build-info and storing it in Artifactory.

For detailed instructions, refer to the OpenShift build project example on GitHub.


Adding Published Docker Images to the Build-Info

The build-docker-create command allows adding a docker image that is already published to Artifactory into the build-info.

To add a published Docker image to the build-info:

ParameterDescription
Command-namert build-docker-create
Abbreviationrt bdc
--image-filePath to a file containing: IMAGE-TAG@sha256:MANIFEST-SHA256
--server-id[Optional] Server ID
--build-name[Optional] Build name
--build-number[Optional] Build number
--project[Optional] JFrog project key
--module[Optional] Module name for build-info
--threads[Default: 3] Number of working threads
Target repositoryThe repository to which the image was pushed

If your Docker image has multiple tags pointing to the same digest, provide them in comma-separated format in the --image-file.

Example

jf rt bdc docker-local --image-file image-file-details --build-name myBuild --build-number 1

Promoting Docker Images

The docker-promote command moves or copies a Docker image from one repository to another in Artifactory.

To promote a Docker image between repositories:

ParameterDescription
Command-namert docker-promote
Abbreviationrt dpr
--server-id[Optional] Server ID
--copy[Default: false] Copy instead of move
--source-tag[Optional] Tag name to promote
--target-docker-image[Optional] Docker target image name
--target-tag[Optional] Target tag to assign after promotion
Source docker imageThe docker image name to promote
Source repositorySource repository in Artifactory
Target repositoryTarget repository in Artifactory

Example

jf rt docker-promote hello-world docker-dev-local docker-staging-local

Note: The jf rt docker-promote command currently requires the source and target repositories to be different. It does not support promoting a Docker image to the same repository while assigning a different target image name.


Troubleshooting

SymptomCauseFix
Podman push/pull 401 errorsAuthentication not configured for PodmanRun podman login <registry-url> or use --server-id
build-docker-create failsImage file format is incorrectEnsure the file contains IMAGE-TAG@sha256:MANIFEST-SHA256
docker-promote fails with same source and target repositorySame-repository promotion is not supportedUse different source and target repositories
Kaniko/buildx integration issuesConfiguration not set up correctlyRefer to the project examples linked above for step-by-step instructions

Enable debug logging: export JFROG_CLI_LOG_LEVEL=DEBUG


Related Topics