docker build with Ubuntu 18.04 image hangs after prompting for Country of origin for keyboard

Viewed 1595

When I build a Ubuntu 18.04 image with docker it prompts for

Country of origin for keyboard:

and after I enter a number it hangs. Here is my Dockerfile:

FROM ubuntu:18.04

RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:graphics-drivers 
RUN apt install nvidia-driver-440 -y

What do I have to do to build a ubuntu 18.04 image with Docker?

2 Answers

You can skip that interactive input if you set this environment variable: DEBIAN_FRONTEND=noninteractive.

The Dockerfile should look like this:

FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:graphics-drivers
RUN apt install nvidia-driver-440 -y
  • Most issues will be solved by adding ENV DEBIAN_FRONTEND=noninteractive in your Dockerfile.

  • Sometimes though, I still get this warning even with this line. This extra line fixes this:


ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
Related