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.
export_container_pathStringDefines the export path of the container’s filesystem as a tar archive.
integration_hashStringThe 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.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
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.

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"
export_container_path: "/exportPath"
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}"
run_as_user: "${user}"
export_container_path: "/exportPath"
variables:
- key: "user"
value: "notRoot"
- key: "top_secret_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true

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"

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}"
export_container_path: "/exportPath"
registry: "my.gcr.com"

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_hash: "5ddb7c180fb38be67bd78a88a"

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
export_container_path: "/exportPath"
working_directory: "/buddy/my-repo-dir"