mirror of
/repos/baseimage-docker.git
synced 2025-12-30 08:01:31 +01:00
Document the new environment variable newline handling in my_init
This commit is contained in:
parent
51748c3b1d
commit
03adf9b696
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
* Upgraded to Ubuntu 14.04 (Trusty). We will no longer release images based on 12.04.
|
* Upgraded to Ubuntu 14.04 (Trusty). We will no longer release images based on 12.04.
|
||||||
Thanks to contributions by mpeterson, Paul Jimenez, Santiago M. Mola and Kingdon Barrett.
|
Thanks to contributions by mpeterson, Paul Jimenez, Santiago M. Mola and Kingdon Barrett.
|
||||||
|
* Fixed a problem with my_init not correctly passing child processes' exit status. Fixes GH-45.
|
||||||
|
* When reading environment variables from /etc/container_environment, the trailing newline (if any) is ignored. This makes commands like this work, without unintentially adding a newline to the environment variable value:
|
||||||
|
|
||||||
|
echo my_value > /etc/container_environment/FOO
|
||||||
|
|
||||||
|
If you intended on adding a newline to the value, ensure you have *two* trailing newlines:
|
||||||
|
|
||||||
|
echo -e "my_value\n" > /etc/container_environment/FOO
|
||||||
|
|
||||||
## 0.9.9 (release date: 2014-03-25)
|
## 0.9.9 (release date: 2014-03-25)
|
||||||
|
|
||||||
|
|||||||
@ -227,7 +227,7 @@ During startup, before running any [startup scripts](#running_startup_scripts),
|
|||||||
|
|
||||||
For example, here's how you can define an environment variable from your Dockerfile:
|
For example, here's how you can define an environment variable from your Dockerfile:
|
||||||
|
|
||||||
RUN echo -n Apachai Hopachai > /etc/container_environment/MY_NAME
|
RUN echo Apachai Hopachai > /etc/container_environment/MY_NAME
|
||||||
|
|
||||||
You can verify that it works, as follows:
|
You can verify that it works, as follows:
|
||||||
|
|
||||||
@ -237,6 +237,12 @@ You can verify that it works, as follows:
|
|||||||
# echo $MY_NAME
|
# echo $MY_NAME
|
||||||
Apachai Hopachai
|
Apachai Hopachai
|
||||||
|
|
||||||
|
**Handling newlines**
|
||||||
|
|
||||||
|
If you've looked carefully, you'll notice that the 'echo' command actually prints a newline. Why does $MY_NAME not contain a newline then? It's because `my_init` strips the trailing newline, if any. If you intended on the value having a newline, you should add *another* newline, like this:
|
||||||
|
|
||||||
|
RUN echo -e "Apachai Hopachai\n" > /etc/container_environment/MY_NAME
|
||||||
|
|
||||||
<a name="envvar_dumps"></a>
|
<a name="envvar_dumps"></a>
|
||||||
#### Environment variable dumps
|
#### Environment variable dumps
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user