YAML parameters for Run Docker containerYAML example for Run Docker containerYAML example for using private image from DockerhubYAML example for using image from private registryYAML example for using image from Google Container RegistryYAML example for using image from Amazon ECRYAML example for using image built in previous action
Run Docker container with YAML
Learn more about:
YAML parameters for Run Docker container
Name | Type | Description |
---|---|---|
action Required | String | The ID of the action. |
type Required | String | The type of the action. Should be set to RUN_DOCKER_CONTAINER . |
docker_image_name Required | String | The name of the Docker image. |
docker_image_tag Required | String | The tag of the Docker image. |
inline_commands Required | String | The commands that will be executed. |
mount_filesystem_disable | Boolean | Defines whether or not to mount the filesystem to the running container. |
volume_mappings | String[] | 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). |
login | String | The username required to connect to a private registry. |
password | String | The password required to connect to a private registry. |
registry | String | The url to the Docker registry or GCR. Required for Google GCR. |
export_container_path | String | Defines the export path of the container’s filesystem as a tar archive. |
integration_hash | String | The ID of the integration. Required for using the image from the Amazon ECR, Google GCR or Docker Hub. |
region | String | The 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_action | Boolean | If set to true the Docker image will be taken from action defined by docker_build_action_id . |
run_as_user | String | All 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_id | Integer | The 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_name | String | The name of the action which built the desired Docker image. Can be used instead of docker_build_action_id . |
entrypoint | String | Default command to execute at runtime. Overwrites the default entrypoint set by the image. |
YAML example for Run Docker container
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 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"
integration_hash: "5ddb7c180fb38be67bd78a88a"
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
actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "buddyworks/private_image"
docker_image_tag: "latest"
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
actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
docker_image_name: "tokyo-house-147623/private_image"
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"
registry: "my.gcr.com"
integration_hash: "5ddb7c180fb38be67bd78a88a"
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"
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_hash: "5ddb7c180fb38be67bd78a88a"
YAML example for using image built in previous action
actions:
- action: "Run container"
type: "RUN_DOCKER_CONTAINER"
use_image_from_action: true
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 April 26, 2022