Run Docker container with YAML

YAML parameters for Run Docker container

You can find the list with common parameters for all Buddy actions here.

NameTypeDescription
action
Required
StringThe ID of the action.
type
Required
StringThe type of the action. Should be set to RUN_DOCKER_CONTAINER.
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
inline_commands
Required
StringThe commands that will be executed.
mount_filesystem_disableBooleanDefines whether or not to mount the filesystem to the running container.
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
loginStringThe username required to connect to the Dockerhub, private registry or GCR.
passwordStringThe password required to connect to the Dockerhub, private registry or GCR.
registryStringThe url to the Docker registry or GCR.
integration_idIntegerThe ID of the integration. Required for using the image from the Amazon ECR.
regionStringThe name of the Amazon S3 region. Required for using the image from the Amazon ECR. The full list of regions is available here.
use_image_from_actionBooleanIf set to true the Docker image will be taken from action defined by docker_build_action_id.
docker_build_action_idIntegerThe ID of the action which built the desired Docker image. If set to 0, the image will be taken from previous pipeline action. Can be used instead of docker_build_action_name.
docker_build_action_nameStringThe name of the action which built the desired Docker image. Can be used instead of docker_build_action_id.
trigger_conditionStringDefines when the build action should be run. Can be one of ALWAYS, ON_CHANGE, ON_CHANGE_AT_PATH, VAR_IS, VAR_IS_NOT or VAR_CONTAINS.
trigger_condition_pathsString[]Required when trigger_condition is set to ON_CHANGE_AT_PATH.
trigger_variable_keyStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS. Defines the name of the desired variable.
trigger_variable_valueStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS. Defines the value of the desired variable which will be compared with its current value.
disabledBooleanWhen set to true the action is disabled. By default it is set to false.
variablesVariable[]The list of variables defined for this action.

YAML example for Run Docker container

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "library/ubuntu"
docker_image_tag: "latest"
inline_commands: "ls -al > ls.log"
trigger_condition: "ON_CHANGE_AT_PATH"
trigger_condition_paths:
- "/src"
- "/tests"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."

YAML example for using private image from Dockerhub

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "buddyworks/private_image"
docker_image_tag: "latest"
inline_commands: "ls -al > ls.log"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
login: "buddyworks"
password: "${top_secret_password}"
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."

YAML example for using image from private registry

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "buddyworks/private_image"
docker_image_tag: "latest"
inline_commands: "ls -al > ls.log"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
login: "buddyworks"
password: "${top_secret_password}"
registry: "my.registry.com"
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."

YAML example for using image from Google Container Registry

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "tokyo-house-147623/private_image"
docker_image_tag: "latest"
inline_commands: "ls -al > ls.log"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
login: "_json_key"
password: "${google_json_key}"
registry: "my.gcr.com"
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."

YAML example for using image from Amazon ECR

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "private_image"
docker_image_tag: "latest"
inline_commands: "ls -al > ls.log"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
region: "us-east-1"
integration_id: 1
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."

YAML example for using image built in previous action

actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
use_image_from_action: true
docker_build_action_id: 0
inline_commands: "ls -al > ls.log"
mount_filesystem_disable: false
working_directory: "/buddy/my-repo-dir"
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."