Run Docker container with YAML

YAML parameters for Run Docker container

NameTypeDescription
action RequiredStringThe ID of the action.
type RequiredStringThe type of the action. Should be set to RUN_DOCKER_CONTAINER.
docker_image_name RequiredStringThe name of the Docker image.
docker_image_tag RequiredStringThe tag of the Docker image.
inline_commands RequiredStringThe commands that will be executed.
mount_filesystem_disableBooleanDefines whether or not to mount the filesystem to the running container.
volume_mappingsString[]The path preceding the colon is the filesystem path (the folder from the filesystem to be mounted in the container). The path after the colon is the container path (the path in the container, where this filesystem will be located).
loginStringThe username required to connect to a private registry.
passwordStringThe password required to connect to a private registry.
registryStringThe url to the Docker registry or GCR. Required for Google GCR.
export_container_pathStringDefines the export path of the container’s filesystem as a tar archive.
integrationStringThe ID of the integration. Required for using the image from the Amazon ECR, Google GCR or Docker Hub.
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.
entrypointStringDefault command to execute at runtime. Overwrites the default entrypoint set by the image.
image_locationStringThe location of the image used by the action. Available values: PUBLIC_REGISTRY, PRIVATE_REGISTRY, ACTION. If the value is other than ACTION, it must be provided together with the docker_registry field. If not provided, the system will automatically set it based on other data from the action.
docker_registryStringThe type of registry from which the image used by the action is retrieved. Available values: NONE, DOCKER_HUB, AMAZON_ECR, GOOGLE_GCR, GOOGLE_ARTIFACT_REGISTRY, OTHER. It must be provided together with image_location. If not specified, the system will automatically set it based on other data from the action.

YAML example for Run Docker container

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" docker_image_name: "library/ubuntu" docker_image_tag: "latest" volume_mappings: - "/:/buddy/mount/directory" inline_commands: "ls -al > ls.log" mount_filesystem_disable: false working_directory: "/buddy/my-repo-dir" export_container_path: "/exportPath" entrypoint: "/bin/sh" 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 Docker hub

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" docker_image_name: "buddyworks/private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "DOCKER_HUB" inline_commands: "ls -al > ls.log" mount_filesystem_disable: false working_directory: "/buddy/my-repo-dir" integration: "my_integration" run_as_user: "${user}" export_container_path: "/exportPath" entrypoint: "/bin/sh" variables: - key: "user" value: "notRoot" - key: "top_secret_password" value: "secure!14ivLMxPgv7TX6c9+ITX/g==" encrypted: true

YAML example for using image from private registry

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" docker_image_name: "buddyworks/private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "OTHER" image_location: "PRIVATE_REGISTRY" docker_registry: "OTHER" entrypoint: "/bin/sh" volume_mappings: - "/:/buddy/mount/directory" 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

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" docker_image_name: "tokyo-house-147623/private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "GCR" volume_mappings: - "/:/buddy/mount/directory" inline_commands: "ls -al > ls.log" mount_filesystem_disable: false working_directory: "/buddy/my-repo-dir" export_container_path: "/exportPath" entrypoint: "/bin/sh" registry: "my.gcr.com" integration: "my_integration"

YAML example for using image from Amazon ECR

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" docker_image_name: "private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "ECR" entrypoint: "/bin/sh" volume_mappings: - "/:/buddy/mount/directory" inline_commands: "ls -al > ls.log" mount_filesystem_disable: false working_directory: "/buddy/my-repo-dir" region: "us-east-1" integration: "my_integration"

YAML example for using image built in previous action

yaml
actions: - action: "Run container" type: "RUN_DOCKER_CONTAINER" image_location: "ACTION" volume_mappings: - "/:/buddy/mount/directory" docker_build_action_id: 0 inline_commands: "ls -al > ls.log" mount_filesystem_disable: false export_container_path: "/exportPath" entrypoint: "/bin/sh" working_directory: "/buddy/my-repo-dir"

Last modified on Sep 23, 2024