0

I'm trying to dockerize my django application and my Django has a dependency with GDAL and I added the dependency command in Dockerfile.

The content in Dockerfile

FROM ubuntu

RUN apt-get update

RUN apt install python -y

RUN apt install python3-pip -y

RUN apt install python3-dev libpq-dev -y

RUN apt-get install gdal-bin

RUN apt-get install libgdal-dev

RUN apt install sudo

WORKDIR /app

COPY . /app

RUN pip3 install -r requirements.txt

ENTRYPOINT ["python3","manage.py" , "runserver" , "0.0.0.0:8000"]

So, the problem here is that 6th line will ask for timezone like to select from 1-99 how can I pass those too as an argument in this file.

So, to solve the above issue I remove line 6 and 7 and also the last line and installed it via docker run -it <image_name> and I committed it to a new image and now I can't execute the command I need which is python3 manage.py runserver 0.0.0.0:8000.

swamper
  • 117
  • 1
  • 10
  • Your line numbers don't seem to make sense here. Are you asking how to pass input to `apt-get install` when it wants to configure a package? – tripleee Aug 23 '21 at 17:46
  • You should be able to `RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install ...` (all packages in a single command) and you won't get prompted. – David Maze Aug 23 '21 at 17:56
  • @tripleee yes that what I’m asking – swamper Aug 23 '21 at 18:01

0 Answers0