Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Settings path in ENV in Dockerfile get overruled?

I do something like this:

FROM registry.access.redhat.com/ubi8/python-39:1-48
USER root

ENV APP_ROOT=/jup\
    PY_PKG_DIR=${APP_ROOT}/src/app-pkg\
    ...

I copy files to that path:

COPY start-singleuser.sh jupyter_notebook_config.py ${PY_PKG_DIR}

I want to set my entrypoint dynamically:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

ENTRYPOINT ["/bin/bash", "$PY_PKG_DIR/start-singleuser.sh"]

This does not work (path is NOT /jup/src/app-pkg, since the files are in a different location.
I found them here:

opt/app-root/src/app-pkg

How does this happen? Is it possible in the baseimage to overrule my APP_ROOT Variable?

>Solution :

if you want to use set one env var from another you should separate declaration, because variables in ENV won’t be set until the command has completed

ENV APP_ROOT=/jup
ENV PY_PKG_DIR=${APP_ROOT}/src/app-pkg \
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading