Skip to content

Instantly share code, notes, and snippets.

@thomasleveil
Created January 13, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasleveil/7428032dcfe9a13432e0 to your computer and use it in GitHub Desktop.
Save thomasleveil/7428032dcfe9a13432e0 to your computer and use it in GitHub Desktop.

See StackOverflow question http://stackoverflow.com/a/34675415/107049

When running this with docker-compose:

docker-compose up
[root@vps229672 tmp]# docker-compose up
Creating tmp_app-no-custom-path_1
Creating tmp_app-with-custom-path_1
Attaching to tmp_app-no-custom-path_1, tmp_app-with-custom-path_1
app-no-custom-path_1   | PATH: /foo
app-with-custom-path_1 | PATH: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/bar
tmp_app-no-custom-path_1 exited with code 0
tmp_app-with-custom-path_1 exited with code 0
app-no-custom-path:
build: .
app-with-custom-path:
build: .
environment:
- PATH=$PATH:/bar
FROM busybox
ENV PATH /foo
CMD /bin/echo "PATH: $PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment