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

bzzcjhmw  于 2022-12-08  发布在  Erlang
关注(0)|答案(1)|浏览(263)

我尝试在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提示符静音?

y0u0uwnf

y0u0uwnf1#

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

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

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

UPD 1:只是为了添加更多的上下文,它不是esl-erlang导致的,而是这个提示来自安装tzdata。
UPD 2:如果您不喜欢UTC,您可能希望手动设置时区,如下所示

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

其中CITY是ls /usr/share/zoneinfo/America/中的一个城市

相关问题