Run Script in Docker Container

With this plugin, you can use a command to run a script in a running Docker container, without logging in to the container.


When you add this plugin step to a chain, modify the following configuration fields:

Field Description
Title Enter a name for the plugin step.
Root context directory for script (Optional) Enter the root context directory, which normally contains the dockerfile for the image.
Docker image name Enter the name of the Docker image where to run the script.
Path to mount workspace (Optional) Enter the path within the container where to mount the workspace.
Type of script Select to use either inline command or file path.
Script language

Select a script language:

  • Shell Script
  • Windows Batch
  • Windows PowerShell
File path If you are using a file path, enter the path to the file that contains the command. Use single quotes to escape spaces in the path name.
Command line If you are using inline command, enter the command you want to run.
Advanced options

(Optional) Specify additional Docker options:

  • Docker host. Enter the Docker host to use. Default: tcp://

  • Path to certificates on Agent. Enter the local file path to certificates on the agent.

Automatically remove container Keep this option selected to automatically remove Docker container.
Control options

(Optional) Expand Control options and define the following settings:

  • Enable step. Leave this option selected to enable the step to run.

    Clearing this option deactivates the step. Disabled steps are displayed crossed out in the list of chain steps.

  • Fail the step. Specify the conditions for failing the step, such as certain findings criteria and/or console log entries.

  • Mark step as unstable. Specify the conditions for making the step unstable, such as certain findings criteria and/or console log entries.

Output variables (Optional) Enter the variables to be passed to other steps down the chain. For details, see Publish output variables.

Back to top

See also: