---
name: codeengine-cmd-args
title: Defining commands and arguments for your workloads
description: When you create a container image for your IBM Cloud&reg; Code Engine workloads, you can define commands and arguments for your job or application to use at run time.
last-updated: 2023-11-17
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/codeengine?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Defining commands and arguments for your workloads
{: #cmd-args}

When you create a container image for your IBM Cloud&reg; Code Engine workloads, you can define commands and arguments for your job or application to use at run time.
{: shortdesc}

Container images include two pieces of metadata that tell the container runtime what command, inside the image to run when the container is created. These metadata fields are called `Entrypoint` and `Command`. For those users who are familiar with Dockerfile, the fields equate to the `ENTRYPOINT` and `CMD` commands. These two fields contain arrays of strings that are combined to create the command line that is used when you run your container. 

For example, if your container image has an `Entrypoint` value of `/myapp` and a `Command` value of `--debug`, then the full command that is run is `/myapp --debug` (an array of two strings). Notice that because this action is a concatenation of two arrays, if `Entrypoint` is an empty array then the `Command` array's first array element is the executable that is run in your container.

When you create a Code Engine application or job, you can provide values for both the `Entrypoint` and `Command` arrays. 

| Description    | Image    | Code Engine name |
| ---------- |  ------ | ------ | 
| The command that is run by the container. | `ENTRYPOINT` | `command` |
| The arguments that are passed to the command.    | `Command`    | `args` |
{: caption="Docker and Code Engine names" caption-side="bottom"}

- If `--command` is used, then any image `Entrypoint` value is overwritten and any image `Command` value is ignored.
- If `--argument` is used, then any image `Command` value is overwritten.




To better understand this process, look at the following examples,

| Image `Entrypoint` | Image `Command` |    Code Engine `command` |    Code Engine `args` |    Command that is run |
| ------ |  ------ | ------ | ------ | ------ |
| `/myapp` |    `--debug` |    `<not set>` |    `<not set>` |    `/myapp --debug` |
| `/myapp` |    `--debug` |    `/myapp2` |    `<not set>` |    `/myapp2` |
| `/myapp` |    `--debug` |    `<not set>` |    `-d` |    `/myapp -d` |
| `/myapp` |    `--debug` |    `/myapp2` |    `-d` |    `/myapp2 -d` |
{: caption="Images and Code Engine examples" caption-side="bottom"}

You can specify these values by using the `--command` and `--argument` options in the CLI for apps and jobs and the `Command` and `Arguments` entry boxes in the console for jobs. For more information, see [Deploying your app with commands and arguments](https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads&format=markdown#deploy-app-cmd-args) and [Running your job with commands and arguments](https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-plan&format=markdown#job-cmd-args).