> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# dockerCreateContainer

> This operation creates a Docker container. It can expose ports and attach volumes. This operation uses Docker CLI, it requires the docker executable t

This operation creates a Docker container. It can expose ports and attach volumes. This operation uses Docker CLI, it requires the docker executable to be on the path of the docker endpoint.

When creating a container from a remote registry image, the operation pulls the image first. If the pull fails (for example authentication, network, or a missing tag), the operation fails immediately and reports the pull error. Enable **Continue on Error** on the workflow step to log the pull failure and continue with container creation.

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Docker Unix Socket</td><td>`FDDKR_UNIX_SOCKET`</td><td>No</td><td>The socket the Docker daemon listens on. Required if Docker Server and Docker Port are not set. Default value is \[/var/run/docker.sock]</td></tr><tr><td>Docker Server Address</td><td>`FDDKR_DOCKER_SERVER`</td><td>No</td><td>The IP address of the Docker server.</td></tr><tr><td>Docker Port</td><td>`FDDKR_DOCKER_PORT`</td><td>No</td><td>The port the Docker service is listening on.</td></tr><tr><td>Docker Registry Account</td><td>`FDDKR_REGISTRY_ACCOUNT_CODE`</td><td>No</td><td>The Docker Registry account to use. Required when docker login is needed to pull the image from a remote registry. The plugin input `FDDKR_INP_REGISTRY_ACCOUNT_CODE` takes precedence over this property.Please refer to the link to set up the Docker Registry Account: [Docker Registry Setup For Cloud Providers](https://docs.flexagon.com/flexdeploy-11-2-documentation/flexdeploy-plugin-guides/flexdeploy-docker-plugin-guide/docker-plugin-appendix/docker-registry-setup-for-cloud-providers.md)</td></tr></tbody></table>

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Docker Image Name</td><td>`FDDKR_IMAGE_NAME`</td><td>No</td><td>The name of the docker image, including the repository if desired. i.e. foo/bar or bar. The Docker image use when creating the container. The plugin input `FDDKR_INP_IMAGE_NAME` takes precedence over this property.</td></tr><tr><td>Docker Image Tag</td><td>`FDDKR_IMAGE_TAG`</td><td>No</td><td>The tag to use when creating the container. The plugin input `FDDKR_INP_IMAGE_TAG` takes precedence over this property.</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Container Name</td><td>`FDDKR_INP_CONTAINER_NAME`</td><td>No</td><td>The name of the container to be created.</td></tr><tr><td>Image Name</td><td>`FDDKR_INP_IMAGE_NAME`</td><td>No</td><td>The name of the docker image, including the repository if desired. i.e. foo/bar or bar. The Docker image use when creating the container. This input will take priority over the `FDDKR_IMAGE_NAME` project property.Note: If `FDDKR_IMAGE_NAME` or `FDDKR_INP_IMAGE_NAME` is specified with preceding "**/**", then the registry address from `FDDKR_REGISTRY_ACCOUNT_CODE or FDDKR_INP_REGISTRY_ACCOUNT_CODE` will get auto prepended to form the full image name.***Example****: *`FDDKR_INP_IMAGE_NAME`*=/nginximage and registry address corresponding to the *`FDDKR_REGISTRY_ACCOUNT_CODE`* is [898334.dkr.ecr.us-east-1.amazonaws.com](http://898334718399.dkr.ecr.us-east-1.amazonaws.com/), then plugin will consider the image name as [898334.dkr.ecr.us-east-1.amazonaws.com](http://898334718399.dkr.ecr.us-east-1.amazonaws.com/)/nginximage.*</td></tr><tr><td>Image Tag</td><td>`FDDKR_INP_IMAGE_TAG`</td><td>No</td><td>The tag to use when creating the container. This input will take priority over the `FDDKR_IMAGE_TAG` project property.</td></tr><tr><td>Docker File</td><td>`FDDKR_INP_DOCKER_FILE`</td><td>No</td><td>The path to a Docker file to use in creation of a container. The relative or absolute path or name of docker file to build, defaults to 'Dockerfile'. Relative path will be with respect to source folders or temp directory.This Input will be ignore if `FDDKR_INP_IMAGE_NAME` or `FDDKR_IMAGE_NAME` is provided to create the container.</td></tr><tr><td>Docker File Arguments</td><td>`FDDKR_INP_DOCKER_FILE_ARGS`</td><td>No</td><td>The docker file arguments to use. These are the ARG instructions in the docker file. KeyValue pairs should be separated by "|" and the key and value should be separated by ",". Example: key1,value|key2,value|key3,valueEscape commas in values with backslashes. ,</td></tr><tr><td>Build Context</td><td>`FDDKR_INP_BUILD_CONTEXT`</td><td>No</td><td>You can pass the relative or absolute path to a local directory as the context for a build.</td></tr><tr><td>Exposed Ports</td><td>`FDDKR_INP_EXPOSED_PORTS`</td><td>No</td><td>A comma separated list of ports to expose on the container and host. (e.g. 8080:28080,22:20022,\[HostPort]:\[ContainerPort]) . For example, if your container exposes an application on port 8080 and you want to access it externally from port 9000 you would put 9000:8080</td></tr><tr><td>Volumes</td><td>`FDDKR_INP_VOLUMES`</td><td>No</td><td>A comma separated list of volumes to attach. Note: This will append the given Volume to the list of VOLUME mentioned in the docker file.</td></tr><tr><td>Container Entrypoint Commands</td><td>`FDDKR_INP_CONTAINER_COMMANDS`</td><td>No</td><td>Csv list of entrypoint commands to pass to the container. Note: This will Overwrite the ENTRYPOINT mentioned in the docker file.</td></tr><tr><td>Network ID Or Name</td><td>`FDDKR_INP_NETWORK_ID`</td><td>No</td><td>The ID or name of the network. This will connect the container to the given network.</td></tr><tr><td>Docker Registry Account</td><td>`FDDKR_INP_REGISTRY_ACCOUNT_CODE`</td><td>No</td><td>The Docker Registry account to use. Required when docker login is needed to pull the image from a remote registry. There are a couple different spots to specify this for convenience.In order of precedence:<ul><li>This plugin input</li><li>Target Property</li></ul>Please refer to the link to set up the Docker Registry Account: [Docker Registry Setup For Cloud Providers](https://docs.flexagon.com/flexdeploy-11-2-documentation/flexdeploy-plugin-guides/flexdeploy-docker-plugin-guide/docker-plugin-appendix/docker-registry-setup-for-cloud-providers.md)</td></tr><tr><td>Additional Options</td><td>`FDDKR_INP_ADDITIONAL_PARAMS`</td><td>No</td><td>Add any additional Options not listed above, which will be added to the run command. (e.g. --cidfile /test/file.cid -d -e MYVAR1)</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Output Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Container ID</td><td>`FDDKR_OUT_CONTAINER_ID`</td><td>No</td><td>The ID of the created container.</td></tr></tbody></table>

# Artifacts

This operation does not produce or consume artifacts.

# Endpoint Selection

This operation will select all available endpoints associated to the target.

# Endpoint Execution

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.
