From 62afa6f904daa67963df97591dac835f60a6c0e0 Mon Sep 17 00:00:00 2001 From: steveperry-53 Date: Fri, 21 Oct 2016 15:52:30 -0700 Subject: [PATCH] Write new task: Defining a Command and Arguments for a Container 3 --- .../define-command-argument-container.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/tasks/configure-pod-container/define-command-argument-container.md b/docs/tasks/configure-pod-container/define-command-argument-container.md index 1e623d9b43..22ac9b5e04 100644 --- a/docs/tasks/configure-pod-container/define-command-argument-container.md +++ b/docs/tasks/configure-pod-container/define-command-argument-container.md @@ -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 %}