I'm new to dockers world. I tried to put my script inside docker, my script takes input argument if running directly in a command prompt -- there are two variables inside my scripts that using input("enter the input here")
argument.
When I tried my scripts directly via cmd python scripts.py
it runs well, but I tried to dockerize my script using docker-compose but it raised
bigquery_1 | Enter input: Traceback (most recent call last):
bigquery_1 | File "./scripts/bq.py", line 6, in <module>
bigquery_1 | default_filterDate_1 = (str(input(" Enter input: ")) or `some default arguments`)
bigquery_1 | EOFError: EOF when reading a line
bigquery_1 exited with code 1
This is what my Dockerfile looks like:
FROM python:3.7
WORKDIR /usr/src/app
COPY ./code /usr/src/app/
RUN pip3 install -r ./requirements.txt
This is the docker-compose.yml
version: '3.8'
services:
bigquery:
build: ./
command: python ./scripts/bq.py
Is there any workaround on how to pass input variables using docker?