在 Ubuntu 上安装 Erlang/Elixir 20.04 在 Docker 容器/静默安装

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

我正在尝试在 Ubuntu 20.04 docker 图像上安装 Erlang/Elixir,但我在 esl-erlang 的地理区域提示上挂断了。如何静音或将默认值设置为 US

这是我的 Docker 图片:

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"]

这里是docker挂断的提示:

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:                                                                                                                                                               

如何让esl-erlang提示静音?

在运行之前设置DEBIAN_FRONTEND=noninteractive apt-get install:

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

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

UPD1: 只是为了添加更多上下文,导致它的不是 esl-erlang,而是这个提示来自安装 tzdata。

UPD2: 如果您不喜欢 UTC,您可能需要像这样手动设置时区

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

其中 CITY 是 ls /usr/share/zoneinfo/America/

中的城市之一