2016-11-29 41 views
1

我在下面的错误消息中运行apt-get install时从一个相当香草的Ubuntu 16.04镜像:apt-get在Ubuntu 16.04中的安装docker image:'/etc/resolv.conf':设备或资源繁忙

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 <[email protected]> 
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}" 
+1

检查此Docker错误条目:https://github.com/docker/docker/issues/1297 – Rambler

回答

0

正如https://github.com/moby/moby/issues/1297提到你可以添加RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections您Dockerfile。这样可以在容器内安装resolvconf