Skip to content

Commit e64b3dd

Browse files
authored
Merge pull request #1062 from JBBianchi/fix-1056-user-defined-container-name
Add support for dynamic container names via runtime expressions
2 parents 509d855 + f2a58fa commit e64b3dd

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

dsl-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ Enables the execution of external processes encapsulated within a containerized
796796
| Name | Type | Required | Description |
797797
|:--|:---:|:---:|:---|
798798
| image | `string` | `yes` | The name of the container image to run |
799+
| name | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to give specific name to the container. |
799800
| command | `string` | `no` | The command, if any, to execute on the container |
800801
| ports | `map` | `no` | The container's port mappings, if any |
801802
| volumes | `map` | `no` | The container's volume mappings, if any |

examples/run-container-with-name.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
document:
2+
dsl: '1.0.0-alpha5'
3+
namespace: test
4+
name: run-container-with-name
5+
version: '0.1.0'
6+
do:
7+
- runContainer:
8+
run:
9+
container:
10+
image: hello-world
11+
name: ${ "hello-\(.workflow.document.name)-\(.task.name)-\(.workflow.id)" }

schema/workflow.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ $defs:
622622
type: string
623623
title: ContainerImage
624624
description: The name of the container image to run.
625+
name:
626+
type: string
627+
title: ContainerName
628+
description: A runtime expression, if any, used to give specific name to the container.
625629
command:
626630
type: string
627631
title: ContainerCommand

0 commit comments

Comments
 (0)