I have a Dockerfile with an ENV declaration for set of paths to be searched that over time has become somewhat comically long:
ENV SPECIAL_PATHS=/foo/bar:/yada/dada:{... ~20 more .. }:/the/end
I cannot see what is the idiomatic way to break in the documentation. I could, of course, define pieces in multiple ENV lines and then combine, but I'd rather not add yet more layers.
You can use \ to break it up over multiple lines.
FROM alpine:3.8
ENV SPECIAL_PATHS \
/foo/bar:\
/yada/yada:\
/the/end
Here's the env in container run from the resulting image.
$ docker container run --rm env-test env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=2fae9abd1eea
SPECIAL_PATHS=/foo/bar:/yada/yada:/the/end
HOME=/root
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With