# Command and Arguments

You can replace the `ENTRYPOINT` and the `CMD` declared in your Dockerfile from your application version or when making a deployment.

{% hint style="danger" %}
This is intended for advanced users. If you are unfamiliar with those concepts, you should leave it to its default value, as it can break your container boot sequence.
{% endhint %}

### Concept

When creating your application version, you can optionally specify the `command` and the `arguments` to override the default value `null`. If left to `null`, the container runtime will use the `ENTRYPOINT` and the `CMD` declared in your Dockerfile.

Otherwise, it will replace the `ENTRYPOINT` and the `CMD` of your container runtime in all deployments of this version.

You can also pass those override parameters inside a Deployment JSON body to override the Application Version.

```json
{
  "app_name": "example",
  "version_name": "v1",
  "ip_list": ["1.2.3.4", "4.3.2.1"],
  "command": "/app/entrypoint.sh",
  "arguments": "--debug"
}
```

{% hint style="info" %}
The deployment body will always override the application version parameters.

The order of override is **`Deployment` > `Application Version` > `Container Default`**
{% endhint %}

### Example

From this Dockerfile:

```json
FROM alpine
COPY . /app
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["--debug", "--port", "$(ARBITRIUM_PORT_GAME_EXTERNAL)"]
```

You can see your container runtime invoked like this: `/app/entrypoint.sh --debug --port 12345`

To change this behavior from the application or the deployment, you can specify it this way:

```json
{
    [...]
    "command": "/app/entrypoint.sh",
    "arguments": "--production --port $(ARBITRIUM_PORT_GAME_EXTERNAL)"
}
```

Which will result in a container runtime invoked like this: `/app/entrypoint.sh --production --port 12345`

{% hint style="info" %}
Please use [injected context variables](https://docs.edgegap.com/learn/orchestration/deployments#injected-environment-variables) if you want to use the command and arguments override with ports like this example.
{% endhint %}
