gpt4 book ai didi

docker - 将软件包安装到ubuntu14.04 Docker容器中

转载 作者:行者123 更新时间:2023-12-02 18:41:15 58 4
gpt4 key购买 nike

我目前有类似的图像正在为virtualbox和 digital ocean 构建,以进行开发和生产(它们正在使用打包程序并且可以构建)。他们正在使用Ubuntu 14.04。

我已经用相同的脚本创建了一个docker版本,没有任何问题。这将用于Gitlab CI环境。

当我在容器中安装软件包时,出现错误。可能与损坏的init系统有关?没东西吗?

我的初始命令是/sbin/init,并且我尝试了是否使用phusion / base-image。

错误是msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" install 'docker-engine'' failed: invoke-rc.d: unknown initscript, /etc/init.d/cgroup-lite not found.
dpkg: error processing package cgroup-lite (--configure):

(是的,这将是一个整体的容器,而不是单进程的,是的,我正在其中运行docker -我将共享docker.sock来完成这项工作。)

最佳答案

因此,我查看了invoke-rd.d的代码,并找到了相关片段。

# If we're running on upstart and there's an upstart job of this name, do
# the rest with upstart instead of calling the init script.
if which initctl >/dev/null && initctl version | grep -q upstart \
&& [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
then
is_upstart=1
elif test ! -f "${INITDPREFIX}${INITSCRIPTID}" ; then
## Verifies if the given initscript ID is known
## For sysvinit, this error is critical
printerror unknown initscript, ${INITDPREFIX}${INITSCRIPTID} not found.
if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then
# If the init script doesn't exist, but the upstart job does, we
# defer the error exit; we might be running in a chroot and
# policy-rc.d might say not to start the job anyway, in which case
# we don't want to exit non-zero.
exit 100
fi
fi

docker取代了init系统,无法在ubuntu docker容器中使用upstart,以及为upstart构建的cgroup-lite的ubuntu软件包的组合,意味着 dpkg --configure失败,因为该服务无法启动。

关于docker - 将软件包安装到ubuntu14.04 Docker容器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39492581/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com