Answer the question
In order to leave comments, you need to log in
Why does the error "python: can't open file '/app/${FILENAME}': [Errno 2] No such file or directory" occur?
I have an image that runs python scripts, which takes an environment variable FILENAME
to know which script to run.
Dockerfile :
FROM python
ARG FILENAME_ARG
ENV FILENAME = $FILENAME_ARG
WORKDIR /app
COPY . .
CMD ["python", "${FILENAME}"]
docker run --env FILENAME=hello_world.py *Image ID*
python: can't open file '/app/${FILENAME}': [Errno 2] No such file or directory
FILENAME
hello_world.py
. But, apparently, something is going wrong. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question