Run a Docker Container

This plugin creates a Docker container, which is a runtime instance of a Docker image.

Configuration

When you add the Run a Docker Container plugin step to a chain, specify the following configuration details:

Field Description
Title Enter a name for the plugin step.
Docker image name Enter a name for the Docker image to be created.
Pull image from registry

(Optional) To pull the Docker image from registry, enter the registry details:

  • URL. Enter the URL that matches the directory in the Docker engine from which you want to access a remote Docker Registry, for example:

    https://registry.company.com/

  • Username. Enter the username of the user with access the Docker Registry.

  • Password. Enter the Docker Registry user's password.

  • Email. Enter the Docker Registry user's email.

Start container (Optional) Start container.
Attach container (Optional) Attach container.
Container name (Optional) Enter the name of the Docker container that will be created.
Port mappings

(Optional) Bind the port number from the Docker host engine into the container. Use this format: host_port:container_port.

For example: 80:8080

Container environment variables

(Optional) Enter environment variables to pass to container, for example:

PULSE_USER=username

Command to run in container (exec)

(Optional) Enter the command to run in the Docker container, for example:

mvn clean install

Container working directory (Optional) Enter the path to the working directory inside the container, for example, /tmp/workspace.
Volumes to mount into container

(Optional) Mount additional host directories as data volumes inside the container. Use this format: host_dir:container_dir.

For example: /app/src:/app

Volumes to mount from other containers (Optional) Mount volumes from another container.
Advanced options (Optional)
Docker host Docker host to use. Default: tcp://0.0.0.0:2376
Local file path on Agent to certificates Local file path on Agent to certificates.
Configuration directory on Agent Configuration directory on Agent.

Back to top

See also: