Install Erlang/Elixir on Ubuntu 20.04 on Docker Container / Silent Install

Viewed 570

I'm trying to install Erlang/Elixir on Ubuntu 20.04 docker image but I get hung up on a prompt with esl-erlang for a Geographic Region. How can I silence or set the default to US?

Here is my Docker Image:

FROM ubuntu:20.04
ENV LANG=en_US.UTF-8

RUN apt-get update -y
RUN apt-get install -y wget gnupg2 inotify-tools locales && \
  locale-gen en_US.UTF-8

RUN wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && dpkg -i erlang-solutions_2.0_all.deb

RUN apt-get update -y
RUN apt-get install -y esl-erlang 
RUN apt-get install -y elixir


CMD ["/bin/bash"]

Here is the prompt that docker gets hung up:

cjsMBP15:ubunutu-elixir cj1$     docker build -t ubuntu-elixir .                           
[+] Building 124.8s (9/11)                                                                                                                                                               
 => [internal] load build definition from Dockerfile                                                                                                                                0.0s
 => => transferring dockerfile: 532B                                                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                     0.7s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                       0.0s
 => CACHED [1/7] FROM docker.io/library/ubuntu:20.04@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93                                                        0.0s
 => CACHED [2/7] RUN apt-get update -y                                                                                                                                              0.0s
 => CACHED [3/7] RUN apt-get install -y wget gnupg2 inotify-tools locales &&   locale-gen en_US.UTF-8                                                                               0.0s
 => CACHED [4/7] RUN wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && dpkg -i erlang-solutions_2.0_all.deb                                                0.0s
 => CACHED [5/7] RUN apt-get update -y                                                                                                                                              0.0s
 => [6/7] RUN apt-get install -y esl-erlang                                                                                                                                       124.1s
 => => #   1. Africa        6. Asia            11. System V timezones                                                                                                                   
 => => #   2. America       7. Atlantic Ocean  12. US                                                                                                                                   
 => => #   3. Antarctica    8. Europe          13. None of the above                                                                                                                    
 => => #   4. Australia     9. Indian Ocean                                                                                                                                             
 => => #   5. Arctic Ocean  10. Pacific Ocean                                                                                                                                           
 => => # Geographic area:                                                                                                                                                               

How can the esl-erlang prompt be silenced?

1 Answers

Set DEBIAN_FRONTEND=noninteractive before running apt-get install:

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y ...

or

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y ...

UPD1: Just to add bit more context, it is not esl-erlang that is causing it, instead this prompt comes from installing tzdata.

UPD2: If UTC is not something you fancy, you may want to set your timezone manually like so

sudo ln -s /usr/share/zoneinfo/America/<CITY> /etc/localtime

where CITY is one of the cities from ls /usr/share/zoneinfo/America/

Related