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.
Write the pipeline file
Section titled “Write the pipeline file”Save this file on your computer as a .yaml file and change the values for your job.
apiVersion: argoproj.io/v1alpha1kind: Workflowmetadata: 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.commandandargs: what to run in the container. The example runsentrypoint.shwithsh.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.
Find your image pull secret
Section titled “Find your image pull secret”The pull secret belongs to a registry in the TIR Container Registry. Only a private image needs one.
- In the side menu, under Storage, select Container Registry.
- Find the registry that holds your image. In its row, select the button in the Commands column.
- 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 underimagePullSecretsin your file.
Create the pipeline and the run
Section titled “Create the pipeline and the run”- Create a pipeline from the file.
- Create a run of it. You can make several runs of one version.
- 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.