# Deploy Docker Image

Use this procedure to create an update flow that uses the Deploy Docker Image step type.

## Prerequisites

* JFrog Connect account and at least one device registered.

* Docker installed on the device.

* One or more Docker images in the JFrog Platform ready for deployment. If you need to push an image to the JFrog Platform, use the `docker tag` and `docker push` commands as shown below.

  <div align="left"><figure><img src="https://content.gitbook.com/content/OX8HIrQ8f257lv49Od1Z/blobs/U1wIlWleyvZ26sfY2yJp/deploy-containers-00.png" alt="" width="536"><figcaption></figcaption></figure></div>

* In the [Create Update Flow](https://app.gitbook.com/o/-MKoacyWO_IyId6sEp-u/s/MJq8oZy7Sjg5aIiKLxrw/deployment/update-flow) procedure, completed through Step 3.

## Add a Step and Configure the Step Type <a href="#add-a-step-and-configure-the-step-type" id="add-a-step-and-configure-the-step-type"></a>

To add a step and configure the step type you have chosen, do the following:

1. In the Create New Flow page, click **Add Step**.
2. In the **Step Type** dropdown list, choose **Deploy Docker Image**, give the step a **Step** **Name**, and create the step. You can change the step name afterwards if you need to.
3. **JFrog Registry:** Choose the JFrog Registry where your artifact is stored. If the registry does not appear in the list, go to [Add JFrog Registry](https://docs.connect.jfrog.io/administration-new-ui/general-settings/registry/add-jfrog-registry) to add yours to the list. Then return to this configuration and the added registry will appear in the list.

{% hint style="success" %}
**Tip**: If you want the step to pull content from an Artifactory Edge account, complete the procedure in [Add JFrog Registry](https://docs.connect.jfrog.io/administration-new-ui/general-settings/registry/add-jfrog-registry), and then choose that registry as your JFrog Registry.
{% endhint %}

<div align="left"><figure><img src="https://1679291640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOX8HIrQ8f257lv49Od1Z%2Fuploads%2FRiF0YAeJBUfNFhx9Kaq8%2Fdeploy-docker-image-nui-01.png?alt=media&#x26;token=9252025a-5de2-4ede-9e9d-3f030a0239b9" alt="" width="563"><figcaption></figcaption></figure></div>

4. Enter the source of your Docker image, which may be one of the following, depending on the registry you chose.

**Image Path**: This is the unique path and file name where the container image is located. For example: `platform-URL/base-repo/docker-repo/docker-image`\
Enter this if you chose **default-connect** for the registry or any other Artifactory registry (see [Deploy Docker](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/step-types/use-single-container)).

{% hint style="success" %}
**Tip**: If you need help finding the parameters above in Artifactory, see [Get Artifactory Parameters for Docker](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/step-types/use-single-container/get-artifactory-parameters).
{% endhint %}

**Image Name**: Enter the docker image name if you chose a **Docker** registry for the registry.

5. Enter the **Image Tag**.
6. **Delete Previous Image**: Mark the checkbox to delete the current image after the new Docker image has been deployed. This is the default setting.

## Run and Command Parameters (Optional)

1. Choose a command from the list and then enter the run flag. These are the same flags used in the docker run command.&#x20;
2. Click **Add** if you want to enter an additional run flag. You can run as many as you want.

<div align="left"><figure><img src="https://content.gitbook.com/content/OX8HIrQ8f257lv49Od1Z/blobs/eLlGIYENcYIwEhhI6tKK/deploy-docker-image-nui-02.png" alt="" width="563"><figcaption></figcaption></figure></div>

### Command

The Docker `run` command structure uses official docker commands, but in a structured manner.

```docker
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
```

To add the command to run in the Docker image, remove all parts except for `[COMMAND] [ARG…]`

For example, in the following CLI deployment:

```docker
docker run alpine:latest echo hello world 
```

the command will be: `echo hello world`

For `[OPTIONS]` use the Docker Run flags.

## On Failure (Optional)

1. Configure your [On Failure](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback) policy and instructions for rolling back.&#x20;
2. Save your step configuration.

## What’s Next?

Learn how to go on to the next step and run the [update deployment](https://docs.connect.jfrog.io/features-new-ui/deployments/update-deployment).
