Write new task: Defining a Command and Arguments for a Container 3
This commit is contained in:
@@ -64,7 +64,7 @@ from the Pod:
|
|||||||
|
|
||||||
In the preceding example, you defined the arguments directly by
|
In the preceding example, you defined the arguments directly by
|
||||||
providing strings. As an alternative to providing strings directly,
|
providing strings. As an alternative to providing strings directly,
|
||||||
you can define arguments by using environment variables.
|
you can define arguments by using environment variables:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- name: MESSAGE
|
- name: MESSAGE
|
||||||
@@ -78,6 +78,18 @@ the techniques available for defining environment variables, including
|
|||||||
and
|
and
|
||||||
[Secrets](/docs/user-guide/secrets/).
|
[Secrets](/docs/user-guide/secrets/).
|
||||||
|
|
||||||
|
NOTE: The environment variable appears in parentheses, `"$(VAR)"`. This is
|
||||||
|
required for the variable to be expanded in the `command` or `args` field.
|
||||||
|
|
||||||
|
### Running a command in a shell
|
||||||
|
|
||||||
|
In some cases, you need your command to run in a shell. For example, your
|
||||||
|
command might consist of several commands piped together, or it might be a shell
|
||||||
|
script. To run your command in a shell, wrap it like this:
|
||||||
|
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "while true; do echo hello; sleep 10;done"]
|
||||||
|
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% capture whatsnext %}
|
{% capture whatsnext %}
|
||||||
|
|||||||
Reference in New Issue
Block a user