gpt4 book ai didi

docker - 在Ubuntu 16.04 docker image : '/etc/resolv.conf' : Device or resource busy中进行apt-get install

转载 作者:行者123 更新时间:2023-12-02 17:46:29 27 4
gpt4 key购买 nike

从相当原始的Ubuntu 16.04镜像中运行apt-get install时,出现以下错误消息:

ln: cannot remove '/etc/resolv.conf': Device or resource busy
dpkg: error processing package resolvconf (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
resolvconf

不过,这些软件包似乎已正确安装。如何解决?

我的Dockerfile看起来像这样:
FROM ubuntu:16.04
MAINTAINER Me Myself <me@myself.com>
RUN apt-get update && apt-get install -y git nano
RUN apt-get upgrade -y

# set the timezone. Note: there is an Ubuntu 16.04 bug which
# requires this to be done this way:
# http://stackoverflow.com/questions/40234847/docker-timezone-in-ubuntu-16-04-image/40235306#40235306
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && dpkg-reconfigure -f noninteractive tzdata

RUN locale-gen en_US en_US.UTF-8 de_DE.UTF-8
ENV PATH="/opt/xyz/bin:${PATH}"

最佳答案

https://github.com/moby/moby/issues/1297中所述,您可以将以下行添加到Dockerfile中:

RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections
这样可以在容器内安装 resolvconf

关于docker - 在Ubuntu 16.04 docker image : '/etc/resolv.conf' : Device or resource busy中进行apt-get install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40877643/

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