命令“ / bin / sh -c apt-get install erlang”返回非零代码:1

时间:2018-09-20 15:37:42

标签: docker dockerfile

我是Docker的初学者,并且正在使用Ubuntu 18.04作为主机。 在寻找解决方案时,我唯一得到的是由于内存不足而增加了VM磁盘的大小。 我没有使用虚拟机。可用磁盘大小为87+ GB。

下面是我的docker文件内容。

FROM ubuntu
RUN apt-get update
RUN apt-get install erlang
EXPOSE 15672

在触发构建时,出现以下错误:

    Sending build context to Docker daemon  1.694GB
    Step 1/4 : FROM ubuntu
     ---> cd6d8154f1e1
    Step 2/4 : RUN apt-get update
     ---> Using cache
     ---> 04473efa791a
    Step 3/4 : RUN apt-get install erlang
     ---> Running in bb7a0664bb20
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following additional packages will be installed:
      adwaita-icon-theme at-spi2-core ca-certificates ca-certificates-java dbus
      dconf-gsettings-backend dconf-service default-jre-headless emacsen-common
      erlang-asn1 erlang-base erlang-common-test erlang-corba erlang-crypto
.
.
.
      notification-daemon openjdk-11-jre-headless openssl shared-mime-info
      ubuntu-mono ucf x11-common xdg-user-dirs xkb-data
    0 upgraded, 202 newly installed, 0 to remove and 1 not upgraded.
    Need to get 137 MB of archives.
    After this operation, 657 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Abort.
    The command '/bin/sh -c apt-get install erlang' returned a non-zero code: 1

1 个答案:

答案 0 :(得分:1)

apt-get要求您确认(您要继续吗?[是/否]中止。)显然不愿提供哪个码头工人。那么 apt-get -y安装erlang 代替?