moby: Cannot install resolvconf on Ubuntu 12.04 containers
Docker currently bind-mounts to the container’s /etc/resolv.conf. This causes problems when installing utilities such as resolvconf/dnsmasq/dhcpd, because /etc/resolv.conf needs to overwritable. Here’s the output when trying to run resolvconf:
lsattr: Inappropriate ioctl for device While reading flags on /etc/resolv.conf
ln: cannot remove `/etc/resolv.conf: Device or resource busy
However, /etc/resolv.conf is a sensible default location. Can we instead make the mount location configurable?
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 1
- Comments: 48 (30 by maintainers)
Commits related to this issue
- docker/docker_entrypoint.sh: Edit `/etc/resolv.conf` using sudo and a subshell. This could actually be very hair because of two things. One Ubuntu prefers that one uses the `resolvconf` command instal... — committed to jakirkham/docker_ubuntu_drmaa_conda by jakirkham 9 years ago
- docker/docker_entrypoint.sh: Edit `/etc/resolv.conf` using sudo and a subshell. This could actually be very hair because of two things. One Ubuntu prefers that one uses the `resolvconf` command instal... — committed to jakirkham/docker_phusion_baseimage_drmaa_conda by jakirkham 9 years ago
- docker/docker_entrypoint.sh: Edit `/etc/resolv.conf` using sudo and a subshell. This could actually be very hair because of two things. One Ubuntu prefers that one uses the `resolvconf` command instal... — committed to jakirkham/docker_phusion_baseimage_drmaa_conda by jakirkham 9 years ago
- [FIX] odoo-shippable: Fix the error related with resolvconf Using the follow solution https://github.com/moby/moby/issues/1297#issuecomment-115458690 — committed to vauxoo-dev/docker-odoo-image by deleted user 7 years ago
- [FIX] odoo-shippable: Install the pylint_odoo and the dependencies for each version of python installed (#287) * [FIX] odoo-shippable: Install the pylint_odoo and the depencies for each version of p... — committed to Vauxoo/docker-odoo-image by deleted user 7 years ago
- Make resolvconf skip the post install see https://github.com/moby/moby/issues/1297 Signed-off-by: Waldz <valdas@mysterium.network> — committed to mysteriumnetwork/node by Waldz 6 years ago
- Make resolvconf skip the post install see https://github.com/moby/moby/issues/1297 Signed-off-by: Waldz <valdas@mysterium.network> — committed to Waldz/node by Waldz 6 years ago
- Make resolvconf skip the post install see https://github.com/moby/moby/issues/1297 Signed-off-by: Waldz <valdas@mysterium.network> — committed to Waldz/node by Waldz 6 years ago
- Make resolvconf skip the post install see https://github.com/moby/moby/issues/1297 Signed-off-by: Waldz <valdas@mysterium.network> — committed to Waldz/node by Waldz 6 years ago
@zuazo I’ve ended up doing something similar:
Hey folks, if you’re like me and ended up here because you’re trying to dockerize some old busted software that insists on installing resolvconf on Ubuntu 12.04, you can workaround it by configuring resolvconf to skip the post install step where it link-ifies /etc/resolv/conf:
RUN apt-get -y install debconf-utils && echo resolvconf resolvconf/linkify-resolvconf boolean false | debconf-set-selections && apt-get -y install resolvconf
Just a quick update, the implemented fixes do not fix that issue that is the
resolvconf
package for Debian, see the followingapt
output on debian jessie:Which in turn prevents packages that depends on
resolvconf
from installing. I could probably create a bunch of fake packages that provide those kind of broken packages, but I’d rather have a nicer way to make it work directly in docker.@gurjeet you may inspire yourself from our ubuntu image (running fine with latest lxc git tree & docker one): https://github.com/makinacorpus/vms/tree/master/docker/makinacorpus/ubuntu_template (see the make.sh 2 level backward to look on how we construct the image (2 times install) )
It would be nice though to have a “just don’t touch the stinking resolv.conf file” option in the cases where you do need to mess with it during a build or you in fact do want 127.0.1.1 to be your name server or the other cases where docker ‘helps’. We used #1383 partly for this purpose – we killed the bind-mount, ADDed an installer script in the Dockerfile and RUN’d the script. So the resolv.conf file is written in the installer script and sticks for the length of it’s execution – actually we write resolv.conf twice in our installer script, but you get the idea. The resolv.conf file is then empty on subsequent RUN commands, but it works. Either way, a “stop ‘helping’ /etc/resolv.conf” option would be great.
Another, wrong way-but-works-way to partly work around this is to remove /var/lib/docker/graph/_tmp/docker/etc/resolv.conf which will keep it out of the way. Since it’s empty, you can recreate it easily enough later.
As an aside, having some switch to add a “search” line to /etc/resolv.conf would be super handy.