How to install ubuntu-server non-interactively?

by NonCreature0714   Last Updated December 24, 2017 22:00 PM

(I'm think belongs on serverfaul or StackOverflow, because it relates to both... but I know SF gets less attention than SO, so I asked both places.)

I'm trying to build a ubuntu-server container for a development environment, but I'm prompted to select a keyboard layout, and character set.

Running a container:

docker run --rm it ubuntu

In the container:

apt-get update && apt-get install -y ubuntu-server

(I'm then eventually prompted to select and keyboard, then charset.)

Container works - but it's interactive :( I want to repeat the process non-interactively with a Dockerfile.

A Dockerfile (which fails):


FROM ubuntu:16.04
RUN apt-get update && apt-get install -y ubuntu-server

Build it:

docker build -t ubuntu-server .

-- Failure

How to build/install ubuntu-server non-interactively in a container?

Answers 1

Add to your Dockerfile before RUN command, this sets noninteractive mode for apt-get:

ENV DEBIAN_FRONTEND noninteractive
December 24, 2017 21:54 PM

Related Questions

Docker: docker-compose and migration

Updated August 24, 2017 16:00 PM