jobs.<job_id>.steps[*].with.args

1 minute read
On this page

Use jobs.<job_id>.steps[*].with.args to define the inputs for a step that executes a Docker container.

args specifications:

  • Enter the args parameter as Unicode strings.

  • An array of strings is not supported.

  • Any argument containing spaces must be surrounded by double quotes ("").

  • CloudBees passes all args to the ENTRYPOINT of the Docker container when the container starts up.

The main purpose of CMD in a Dockerfile is to provide defaults for an executing container. Instead, you can provide this instruction by defining args in your job.

If you do use CMD in your Dockerfile, you must use one of the following workflow guidelines:

  1. (Recommended) delete any required arguments from CMD.

  2. Define appropriate defaults so that you can run without specifying any arguments.

  3. If a --help flag, or something similar is available, use that as the default for documentation.

Example usage

In the following example, the step documentation is entered as args.

steps:
  - name: Document the trigger event for this step
    uses: docker://alpine:3.18
    with:
      entrypoint: /bin/echo
      args: This step is triggered by ${{ cloudbees.event_name }}.