Skip to content

Run a Docker image as a pipeline

View as Markdown

Run your own container image as a pipeline step. Write an Argo Workflow file that names the image, the command, and its arguments, then upload it as a pipeline. You can change the entry point to suit the job, and run it once or on a schedule. If you are new to pipelines, start with Get started with Pipelines.

Save this file on your computer as a .yaml file and change the values for your job.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: your-workflow-name
labels:
workflows.argoproj.io/archive-strategy: "false"
annotations:
workflows.argoproj.io/description: |
An example to run jobs with an entrypoint script inside the Docker Container.
spec:
entrypoint: your-entrypoint-name
imagePullSecrets:
- name: your-image-pull-secret
templates:
- name: your-entrypoint-name
container:
image: your-docker-image-url
command: ["sh"]
args: ["entrypoint.sh"]

Change these values:

  • image: the URL of your Docker image.
  • command and args: what to run in the container. The example runs entrypoint.sh with sh.
  • imagePullSecrets: the pull secret for a private image. Remove this block for a public image.
  • entrypoint: the name of the template to start with.

TIR names the workflow itself, in place of the name in the file. For the file format, see the Argo Workflows documentation.

The pull secret belongs to a registry in the TIR Container Registry. Only a private image needs one.

  1. In the side menu, under Storage, select Container Registry.
  2. Find the registry that holds your image. In its row, select the button in the Commands column.
  3. In the Docker Commands panel, find the line that begins ImagePullSecret Name. The name below it is the pull secret, in the form namespace-secret-<registry id>. Put it under imagePullSecrets in your file.
  1. Create a pipeline from the file.
  2. Create a run of it. You can make several runs of one version.
  3. Open the run and its step’s Logs to follow it; see Watch a run and read its logs.

To change the image or the command later, create a pipeline version and run that version.