Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This operation builds an image from a docker file.  It will not create or start a container. This operation uses Docker CLI, it requires the docker executable to be on the path of the docker endpoint.

Target Properties

Property Name

Property Code

Required

Description

Docker Unix Socket

FDDKR_UNIX_SOCKET

No

The socket the Docker daemon listens on. Required if Docker Server and Docker Port are not set. Default value is [/var/run/docker.sock]

Docker Server Address

FDDKR_DOCKER_SERVER

No

The IP address of the Docker server.  Required if Docker Unix Socker is not set.

Docker Port

FDDKR_DOCKER_PORT

No

The port the Docker service is listening on.  Required if Docker Unix Socker is not set.

Docker Registry Account

FDDKR_REGISTRY_ACCOUNT_CODE

No

The Docker Registry account to use. Required when we want to push the image or the base image mentioned in the Docker file residing in a remote registry and require login to pull the image. 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

...

Property Name

Property Code

Required

Description

Docker Image Repository Name

FDDKR_IMAGE_NAME

No

The name of the docker image, including the repository if desiredProvide docker repository name with optional namespace. i.e. foo/bar or bar. The plugin input FDDKR_INPUTINP_IMAGE_NAME takes precedence over this property.

Docker Image Tag

FDDKR_IMAGE_TAG

No

The Provide tag of to apply to the docker built image. Use comma-separated values to specify multiple tags. For example: 1.0,2.0,3.0 . The plugin input FDDKR_INPUTINP_IMAGE_TAG takes precedence over this property.

...

Input Name

Input Code

Required

Description

Docker File

FDDKR_INP_DOCKER_FILE

No

The path to the Docker File to build. If empty Dockerfile is used as the name, and it is searched as specified in the next line.

If an absolute path is given, it is used. Otherwise, the file is checked for relative to the FD_TEMP_DIR and any checkout folders.

Docker File Arguments

FDDKR_INP_DOCKER_FILE_ARGS

No

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,value

Escape commas in values with backslashes. \,

Image Build Context

FDDKR_INP_BUILD_CONTEXT

No

You can pass the relative or absolute path to a local directory as the context for a build.

Docker Repository Name

FDDKR_INP_IMAGE_NAME

No

The Docker image use when running the containerProvide docker repository name with optional namespace. i.e. foo/bar or bar. This input will take priority over the FDDKR_IMAGE_NAME project property.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#E6FCFF

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, then plugin will consider the image name as 898334.dkr.ecr.us-east-1.amazonaws.com/nginximage.

Image Tag

FDDKR_INP_IMAGE_TAG

No

The Provide tag to use when creating the containerapply to the built image. Use comma-separated values to specify multiple tags. For example: 1.0,2.0,3.0 . This input will take priority over the FDDKR_IMAGE_TAG project property.

Docker Registry Account

FDDKR_INP_REGISTRY_ACCOUNT_CODE

No

The Registry you Docker Registry account to use. Required when we want to push the image or the base image mentioned in the Docker file residing in a remote registry and require login to pull the image. There are a couple different spots to specify this for convenience.

In order of precedence:

  • Target Property

  • This plugin input.

  • Target Property

Please refer to the link to set up the Docker Registry Account: Docker Registry Setup For Cloud Providers

Push Image to repository

FDDKR_INP_PUSH_IMAGE

No

Push Image to repository.to configured Registry.

Tag Image with latest tag

FDDKR_INP_TAG_LATEST

No

Check to tag built image with 'latest' tag.

Additional Options

FDDKR_INP_ADDITIONAL_PARAMS

No

Add any additional options not listed above, which will be added to the build command. e.g. --cpu-period=100000 --cpu-quota=150000

Outputs

Output Name

Description

FD_BUILT_DOCKER_IMAGE_ID

The image id that was created from the operation.  The IMAGE_ID column when running the command 'docker images'. This output will always be made available to the deploy workflow.

FD_BUILT_DOCKER_IMAGE_NAME

The built docker image name. The IMAGE_NAME column when running the command ‘docker images'. This output will always be made available to the deploy workflow.

FD_BUILT_DOCKER_IMAGE_TAG

The tag of the built image. This output will always be made available to the deploy workflow.

FD_BUILT_DOCKER_IMAGE

The built docker image. This output will always be made available to the deploy workflow.

FD_BUILT_DOCKER_LINK

The link to the built docker image when pushed to a repository. This output will always be made available to the deploy workflow.

Artifacts

This operation consumes a Dockerfile from the artifacts repository.  Can also be overridden through the docker file input.

Endpoint Selection

This operation delegates the selection to the workflow developer to determine.

...

This operations delegates the execution to the workflow developer to decide.

Special Considerations

Build Args were not consumed

If using the 'Docker File Arguments' input and the docker file doesn't contain a matching ARG instruction, the operation will fail with the following error:

...

To correct this, either remove the key/value mapping from the input or add an ARG instruction for the missing key in your docker file.

Docker Repository Required?

...

docker tag %ImageId% %RepoName%:%tagName%

To tag the image you can also use dockerTagImage operation.