diff --git a/Changelog.md b/Changelog.md index 6a81654..1274238 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,14 @@ * 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. + * 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) diff --git a/README.md b/README.md index 16a5e0e..4ce0315 100644 --- a/README.md +++ b/README.md @@ -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: - 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: @@ -237,6 +237,12 @@ You can verify that it works, as follows: # echo $MY_NAME 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 + #### Environment variable dumps