I have the below Dockerfile
where I need to interpolate the filename to be run.
ARG PYTHON_VERSION=3.7-alpine
# Use the python image as the base image
FROM python:${PYTHON_VERSION}
# set environment to run
ENV ENVIRONMENT={ENVIRONMENT:-"prod"}
# Copy the python files
COPY requirements.txt /app/
COPY prod.py dev.py requirements.txt /app/
# Set the working directory
WORKDIR /app
# Install the dependencies
RUN pip install -r requirements.txt
# Set the command to run the python file when the container is started
CMD ["python", "${ENVIRONMENT}.py"]
But when I build the image and run it, I get the following error:
python: can't open file '${ENVIRONMENT}.py': [Errno 2] No such file or directory
Why this is not interpolated correctly? Can someone help me with this?