I feel like I tried everything including using shell/exec forms, but I still can't figure out why the ENV variables aren't being recognized. You can see below the different variations of commands I tried using. The ENV variables are there for default values, but I plan to be able to change them through command-line arguments when running the container as well (which I'm not sure how to neither at the moment).
# syntax=docker/dockerfile:1 (IS THIS LINE NECESSARY AT ALL NOWADAYS?)
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
ENV INPUT="--input ./histogram_input"
ENV OUTPUT="--output ./TEST.tsv"
ENV BUCKET_COUNT="--bucket-count 9999"
ENTRYPOINT ["python", "CreateWeatherHistogram.py", "${INPUT}", "${OUTPUT}", "${BUCKET_COUNT}"]
# ENTRYPOINT ["python", "CreateWeatherHistogram.py", "${input}", "${output}", "${bucket_count}"] # DOESNT WORK
# ENTRYPOINT ["python", "CreateWeatherHistogram.py", "${input} ${output} ${bucket_count}"] # DOESNT WORK
# ENTRYPOINT python CreateWeatherHistogram.py ${input} ${output} ${bucket_count} # DOESNT WORK
# ENTRYPOINT python CreateWeatherHistogram.py "$input" "$output" "$bucket_count" # DOESNT WORK
My python app is called with:
CreateWeatherHistogram --input ./histogram_input --output ./histogram.tsv --bucket-count 5
I want to be able to run this container with:
docker run --mount type=bind,source=/,target=/app [IMAGE-NAME] --input input.file --output output.file --bucket-count x