将软件包安装到ubuntu14.04 docker容器中
我目前有类似的图像正在为虚拟机和数字海洋开发和生产(他们正在使用打包机和可以build立)。 他们正在使用Ubuntu 14.04。
我已经从相同的脚本创build了一个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):
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
Dockerreplaceinit系统,无法在Ubuntu Docker容器中使用新手,以及用于cgroup-lite的ubuntu软件包被组build起来,这意味着dpkg --configure
失败,因为服务无法启动。