Docker Community Forums

Share and learn in the Docker community.

Upstream ENV overrides?

Hi,

If I’d like for instance to create my own tomcat docker build using an official tomcat docker image, am I forced to accept what an upstream developer has set for an ENV variable in their Dockerfile?

e.g. if I’d like to override the value of CATALINA_HOME from /usr/local/tomcat > /home/user/foo/bar/another

Can I do this in my Dockerfile in a way that overrides what was set in the image I’m basing my Dockerfile off of so that the dockerbuild process uses the path I wish so that the tomcat folder is built to /home/user/foo/bar/another/tomcat ?

e.g this doesn’t work in the sense of influencing the build process upstream

FROM tomcat:8.5.54-jdk8-openjdk

ENV CATALINA_HOME /home/user/foo/bar/another

CMD ["catalina.sh", "run"]

Thanks in advance for any guidance as I’m new to learning Docker.