在 docker 容器上安装 libsndfile1

问题描述

我正在尝试在我的 docker 容器上通过 pip install 安装声音文件。遗憾的是,我需要自己在 libsndfile1 上手动安装 apt get。这以某种方式失败了,我真的不明白为什么,有没有人知道如何安装它。

我在 Win10 上运行 docker 桌面 - 但容器最终将在 Linux 机器上运行。

 > [ 7/11] RUN apt-get install libsndfile1:
#11 0.618 Reading package lists...
#11 1.814 Building dependency tree...
#11 2.219 Reading state information...
#11 2.829 The following additional packages will be installed:
#11 2.830   libflac8 libogg0 libvorbis0a libvorbisenc2
#11 2.942 The following NEW packages will be installed:
#11 2.944   libflac8 libogg0 libsndfile1 libvorbis0a libvorbisenc2
#11 2.956 0 upgraded,5 newly installed,0 to remove and 3 not upgraded.
#11 2.956 Need to get 669 kB of archives.
#11 2.956 After this operation,2136 kB of additional disk space will be used.
#11 2.956 Do you want to continue? [Y/n] Abort.
------
executor failed running [/bin/sh -c apt-get install libsndfile1]: exit code: 1

有人知道吗?

解决方法

使用带有自动 yes 的命令使其以非交互方式运行。

RUN apt-get --yes install libsndfile1

仅供参考 - 这个危险的 --force-yes 选项也可用。

如有必要,请绝对酌情使用。

阅读 apt-get 选项 here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...