Write new task: Defining a Command and Arguments for a Container 3

reviewable/pr1526/r3
steveperry-53 2016-10-21 15:52:30 -07:00
parent 9b18efd334
commit 62afa6f904
1 changed files with 13 additions and 1 deletions

View File

@ -64,7 +64,7 @@ from the Pod:
In the preceding example, you defined the arguments directly by
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:
- name: MESSAGE
@ -78,6 +78,18 @@ the techniques available for defining environment variables, including
and
[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 %}
{% capture whatsnext %}