1

I'm trying to make a dockerfile with the base image ubuntu:latest and nginx on it. The problem is that everything installs perfectly but the moment Nginx gets installed it asks for a geographic area and timezone. Screenshot Terminal

Is there a way to someway silent install Nginx or install a version that doesn't ask these questions?

Command I use:
apt-get install nginx -y

The -s flag doesn't do anything.

Sergey Nazarov
  • 671
  • 3
  • 15
NoahNxT
  • 156
  • 12

1 Answers1

2

The prompt for geographic location is from tzdata, you can see that from few lines before the included screenshot.

To work around the issue I added in a RUN directive:

RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata

Now "apt-get install nginx -y" will not prompt for the geographic location.

The officila nginx image in Docker Hub has a Dockerfile with more packages installed, you may want to look for reference here.

ddorsogna
  • 116
  • 5
  • 1
    Thanks @ddors! Your command was a push in the right way. Command wasn't working but after some research I found that you could do this simply: `ARG DEBIAN_FRONTEND=noninteractive` – NoahNxT May 05 '21 at 15:54