I’ve got three new servers running Ubuntu 16.04 & apparently have some Docker problem. Though I suspect it’s a trivial and “obvious” Docker problem, I’ve searched more widely for answers, but have come up empty. I’d like to think that it’s some new Docker bug (and not something stupid that I’ve done), but clean installs on Digital Ocean work fine.
It seems that the container can’t download gems.
Docker version 18.04.0-ce, build 3d479c0
I, [2018-05-04T00:42:53.689239 #15] INFO -- : > echo "done configuring web"
I, [2018-05-04T00:42:53.690557 #15] INFO -- : done configuring web
I, [2018-05-04T00:42:53.690718 #15] INFO -- : > cd /var/www/discourse && gem update bundler
ERROR: While executing gem ... (SocketError)
getaddrinfo: Name or service not known
I, [2018-05-04T00:42:53.829426 #15] INFO -- : Updating installed gems
I, [2018-05-04T00:42:53.829592 #15] INFO -- : Terminating async processes
I, [2018-05-04T00:42:53.829620 #15] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec
It looks like it can’t resolve something, but I’ve tried putting DOCKER_OPTS="--dns 1.0.0.1 --dns 1.1.1.1"
in/etc/default/docker
(as suggested here) and no joy. Another container I can get in to and ping google.com
. (That container is a VPN, which worked fine for a while and I can’t connect to now; I have no idea whether that’s related.)
I tried this (as suggested here):
docker run -it --rm ubuntu bin/bash
apt upgrade
apt install iputils-ping
ping google.com
and it works.
The host has several static IPs. Could docker not know how to bind to them to the right one? No. I changed to a single IP and that didn’t fix it.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:e0:4c:68:02:54 brd ff:ff:ff:ff:ff:ff
inet 38.242.7.195/28 brd 38.242.7.207 scope global enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::2e0:4cff:fe68:254/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:6f:3a:ac:26 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:6fff:fe3a:ac26/64 scope link
valid_lft forever preferred_lft forever
6: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:e3:f5:bd brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:e3:f5:bd brd ff:ff:ff:ff:ff:ff