0

My Dockerfile has:

ENV PROXY_HOST=sub.proxy.domain.com
ENV PROXY_PORT=8080
RUN sed -i 's/# https.proxyHost=/https.proxyHost=$PROXY_HOST/g' /opt/coldfusion/jre/conf/net.properties

But when I check /opt/coldfusion/jre/conf/net.properties, the line just reads:

https.proxyHost=$PROXY_HOST

For some reason it is not doing the variable substitution. I also tried using ${PROXY_HOST} syntax. It just seems to literally interpret the variable name. I also tried to use ARG feature for Docker and the same syntax for the RUN command variables, and that did not work.

When I read the documentation and other StackOverflow answers, I feel like I am following the correct steps.

What am I missing here?

gwizzo
  • 49
  • 8
  • 2
    It's not a Docker-specific problem -- you'd have the same issue running the same sed command on a normal shell command line. Single-quotes _always_ suppress parameter expansion; if you want the variable to be substituted, use double quotes. – Charles Duffy Feb 15 '23 at 17:24
  • I just found this as well, thank you @CharlesDuffy – gwizzo Feb 15 '23 at 17:26

0 Answers0