Run Docker container with YAML
Tip
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 | 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. |
image_location | String | The 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_registry | String | The 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
yamlactions: - 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
yamlactions: - 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
yamlactions: - 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
yamlactions: - 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
yamlactions: - 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
yamlactions: - 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