abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
768 stars 315 forks source link

Variable ACME_AGREE not interpolated? #122

Closed hartwork closed 6 years ago

hartwork commented 6 years ago

Hi Abiola,

thanks for sharing your Caddy images with the free software community! (I based my reverse proxy upon your images.)

One thing caught my attention: With the way that ACME_AGREE is used in ..

CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]

.. $ACME_AGREE is not interpolated by Docker because of the use of CMD [..] syntax, right? Is anything else interpolating ACME_AGREE, e.g. /bin/parent in ENTRYPOINT?

Here's proof that Docker itself does not interpolate it (on a Bash terminal):

$ echo $'#! /bin/sh\nset -x\nexec "$@"' > parent && chmod +x parent && docker run -v "${PWD}"/parent:/bin/parent abiosoft/caddy:no-stats |& head -n2
+ exec caddy --conf /etc/Caddyfile --log stdout --agree=$ACME_AGREE
invalid boolean value "$ACME_AGREE" for -agree: strconv.ParseBool: parsing "$ACME_AGREE": invalid syntax

I'm probably missing something?

Best, Sebastian

abiosoft commented 6 years ago

Yeah, docker doesn't and that's why I wrote the parent script to get around it. parent handles the interpolation as well as signal forwarding to caddy process.

abiosoft commented 6 years ago

This is actually not an issue so I'll be closing, but we can continue discussion.

hartwork commented 6 years ago

Thanks! Found it in https://github.com/abiosoft/parent/blob/master/main.go#L61 now.