I am trying to build a docker image using ubuntu:latest on a Mac. I am using a shell file to collect the set up steps but the building stops when the container runs apt-get update.
The error is:
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Connection failed [IP: 185.125.190.39 80]
My Dockerfile is:
FROM ubuntu
RUN chmod +x set_up.sh
RUN ./set_up.sh
while set_up.sh is
#!/bin/sh
#1. Update package manager
apt-get update
For context, I get the same error if I use
docker run --rm -it ubuntu:latest /bin/bash
root#fca959160783:/# apt-get update
0% [Waiting for headers] [Waiting for headers]
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Connection failed [IP: 185.125.190.39 80]
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Connection failed [IP: 185.125.190.39 80]
Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Connection failed [IP: 185.125.190.39 80]
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Connection failed [IP: 91.189.91.38 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Connection failed [IP: 185.125.190.39 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Connection failed [IP: 185.125.190.39 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Connection failed [IP: 91.189.91.38 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Connection failed [IP: 185.125.190.39 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
with the command hanging at 0% [Waiting for headers] [Waiting for headers] for a long time before producing the rest of the outcome.
I am new to docker but I've been running the same code yesterday on a different WiFi connection and I didn't experience any issue. I have tried adding the options --network=host to the build command or my current DNS IP address in the docker run version of the example but I get the same issues and I am not sure what to do now. I'd appreciate any suggestions you might have on this issue.
Thanks a lot for your help!
It could be architecture mismatch.
Check docker architecture with: docker info | grep Architecture
Check image architecture with: docker inspect ubuntu
In the case of mismatch you should reinstall docker.
Related
i am trying to build a docker from the tensorflow dockerhub, using tensorflow version 2.4.3, i did a simple pull and docker file:
$ docker pull tensorflow/tensorflow:2.4.2-gpu
And here is the dockerfile:
FROM tensorflow/tensorflow:2.4.3-gpu
ADD . /path
WORKDIR /path
RUN apt-get -y update
RUN apt-get -y install sudo
However i get errors on the apt-get update line:
$ docker build -t tensorflow_gpu_build .
...
Step 4/10 : RUN apt-get -y update
---> Running in 7c67f26124cb
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease [1581 B]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1573 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [83.3 kB]
Err:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease
The following signatures couldn''t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [3145 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [1371 kB]
Ign:9 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 InRelease
Hit:10 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Release
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [1412 kB]
Get:12 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [22.9 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2351 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3568 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [30.8 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [64.0 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [20.5 kB]
Reading package lists...
W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn''t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is no longer signed.
I am unsure of where the problem is coming from, the same dockerfile worked fine on the latest tensorfow docker version, could it be normal behaviour because the tensorflow version is a little old?
It's possible that the key included in the image has been revoked by Nvidia in the meantime.
So, you have three possibilities:
You can check for a valid pub key for that repository, copy it to the image via Dockerfile and add it with this command:
apt-key add /path/to/key
You can add an "[ allow-insecure=yes ]" to the respective line in the /etc/apt/sources.list as elaborated here: https://unix.stackexchange.com/questions/198000/bypass-gpg-signature-checks-only-for-a-single-repository
You could try a newer image.
I'm following this guide to set up a mitmproxy proxy server locally on Ubuntu in order to capture network traffic on my local machine and docker containers.
After setting up a transparent proxy, I'm able to capture network traffic for my local machine, but can't seem to intercept requests coming from my docker containers. The instructions specify to edit ~/.docker/config.json to automatically set your proxy environment variables when you run your containers:
{
"proxies":
{
"default":
{
"httpProxy": "http://127.0.0.1:8080",
"httpsProxy": "http://127.0.0.1:8080"
}
}
}
Where port 8080 points to the port that mitmproxy is listening to. Granted this should only work when you run the container with --network="host" so that the container and local machine share the same address space. However it doesn't work, when I run a barebones ubuntu container in interactive mode (docker container run --network="host" -it ubuntu) and run apt update I get the following errors and don't see any traffic in mitmproxy:
Ign https://esm.ubuntu.com trusty-infra-security InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Ign http://archive.ubuntu.com trusty InRelease
Ign https://esm.ubuntu.com trusty-infra-updates InRelease
Ign https://esm.ubuntu.com trusty-infra-security Release.gpg
Ign http://archive.ubuntu.com trusty-updates InRelease
Err http://security.ubuntu.com trusty-security Release.gpg
Connection failed
Ign https://esm.ubuntu.com trusty-infra-updates Release.gpg
Ign https://esm.ubuntu.com trusty-infra-security Release
Ign http://archive.ubuntu.com trusty-backports InRelease
Ign http://security.ubuntu.com trusty-security Release
Ign https://esm.ubuntu.com trusty-infra-updates Release
Err http://archive.ubuntu.com trusty Release.gpg
Connection failed
Err http://archive.ubuntu.com trusty-updates Release.gpg
Connection failed
Err http://archive.ubuntu.com trusty-backports Release.gpg
Connection failed
Ign http://archive.ubuntu.com trusty Release
Err https://esm.ubuntu.com trusty-infra-security/main amd64 Packages
Proxy CONNECT aborted
Ign http://archive.ubuntu.com trusty-updates Release
Err https://esm.ubuntu.com trusty-infra-updates/main amd64 Packages
Proxy CONNECT aborted
Ign http://archive.ubuntu.com trusty-backports Release
Ign http://archive.ubuntu.com trusty/main amd64 Packages/DiffIndex
Ign http://archive.ubuntu.com trusty/restricted amd64 Packages/DiffIndex
Err http://security.ubuntu.com trusty-security/main amd64 Packages
Connection failed
Err http://security.ubuntu.com trusty-security/restricted amd64 Packages
Connection failed
Err http://security.ubuntu.com trusty-security/universe amd64 Packages
Connection failed
Err http://security.ubuntu.com trusty-security/multiverse amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty/universe amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty/multiverse amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-updates/main amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-updates/restricted amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-updates/universe amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-backports/main amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-backports/restricted amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-backports/universe amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty/main amd64 Packages
Connection failed
Err http://archive.ubuntu.com trusty/restricted amd64 Packages
Connection failed
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Connection failed
W: Failed to fetch https://esm.ubuntu.com/ubuntu/dists/trusty-infra-security/main/binary-amd64/Packages Proxy CONNECT aborted
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Connection failed
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages Connection failed
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/restricted/binary-amd64/Packages Connection failed
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages Connection failed
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/multiverse/binary-amd64/Packages Connection failed
W: Failed to fetch https://esm.ubuntu.com/ubuntu/dists/trusty-infra-updates/main/binary-amd64/Packages Proxy CONNECT aborted
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/multiverse/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/multiverse/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/main/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/restricted/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/universe/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/multiverse/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/Packages Connection failed
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/binary-amd64/Packages Connection failed
E: Some index files failed to download. They have been ignored, or old ones used instead.
I've also tried running the container with the default bridged network and editing the proxy config to point to the local machine instead with host.docker.internal:8080 (docker container run -it --add-host=host.docker.internal:host-gateway ubuntu). This time after running apt update, I AM able to observe network traffic in mitmproxy, but the command doesn't work and these error logs are printed in the container:
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Connection failed [IP: 172.17.0.1 8080]
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
502 Bad Gateway [IP: 172.17.0.1 8080]
Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
502 Bad Gateway [IP: 172.17.0.1 8080]
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
502 Bad Gateway [IP: 172.17.0.1 8080]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease 502 Bad Gateway [IP: 172.17.0.1 8080]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease 502 Bad Gateway [IP: 172.17.0.1 8080]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease 502 Bad Gateway [IP: 172.17.0.1 8080]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Connection failed [IP: 172.17.0.1 8080]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Does anyone know what's going wrong here? I suspect it could also have to do with slow download speeds via the proxy, as running docker pull node:16 times out when my local machine tries downloading it through the proxy. I also suspect that it may have something to do with certificate authorization (apt update seems to use https to fetch resources), but when I tried running a curl container and making an http request it timed out as well. I might just try adjusting the setup to use the mitmproxy image instead of running it locally, but I feel I might end up running into similar issues. Any help is greatly appreciated thank you!
I'm following these instructions to install Docker: https://docs.docker.com/engine/install/debian/
I've successfully created /etc/apt/sources.list.d/docker.list:
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian stretch stable
However, when I run sudo apt-get update, I get this error about not being able to fetch https://download.docker.com/linux/debian/dists/stretch/InRelease:
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:4 http://debian.mirror.iweb.ca/debian stretch InRelease
Hit:5 http://ftp.debian.org/debian stretch-backports InRelease
Hit:6 http://deb.debian.org/debian oldstable InRelease
Hit:7 http://debian.mirror.iweb.ca/debian stretch-updates InRelease
Hit:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Hit:9 http://debian.mirror.iweb.ca/debian stretch Release
Ign:11 http://archive.debian.org/debian jessie InRelease
Hit:12 http://archive.debian.org/debian jessie Release
Reading package lists... Done
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: Failed to fetch https://download.docker.com/linux/debian/dists/stretch/InRelease
W: Some index files failed to download. They have been ignored, or old ones used instead.
Has anyone run into this issue?
Docker Hub pull debian:stable image, but using apt update command ocurs some problems
Docker Hub debian:stable image
sources.list
deb [trusted=yes] http://deb.debian.org/debian stable main
deb [trusted=yes] http://deb.debian.org/debian stable-updates main
Error Message:
-----------------------------------------------------------
Ign:1 http://deb.debian.org/debian stable InRelease
Ign:2 http://deb.debian.org/debian stable Release
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Ign:4 http://deb.debian.org/debian stable/main amd64 Packages
Ign:3 http://deb.debian.org/debian stable/main all Packages
Err:4 http://deb.debian.org/debian stable/main amd64 Packages
SECURITY: URL redirect target contains control characters, rejecting. [IP: 5.153.231.4 80]
Reading package lists... Done
E: Failed to fetch http://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages SECURITY: URL redirect target contains control characters, rejecting. [IP: 5.153.231.4 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
I'm a docker newbie so bear with me --
I'm trying to install packages on docker images. I can't get anywhere on a Debian based image.
C:\me\docker-images> docker run --rm -it debian:stretch
root#74414ba0234b:/# apt-get update
Err:1 http://security.debian.org/debian-security stretch/updates InRelease
Could not connect to security.debian.org:80 (149.20.4.14). - connect (111: Connection refused) [IP: 149.20.4.14 80]
Err:2 http://deb.debian.org/debian stretch InRelease
Could not connect to deb.debian.org:80 (149.20.4.15). - connect (111: Connection refused) [IP: 149.20.4.15 80]
Err:3 http://deb.debian.org/debian stretch-updates InRelease
Unable to connect to deb.debian.org:http: [IP: 149.20.4.15 80]
Reading package lists... Done
W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease Could not connect to deb.debian.org:80 (149.20.4.15). - connect (111: Connection refused) [IP: 149.20.4.15 80]
W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease Unable to connect to deb.debian.org:http: [IP: 149.20.4.15 80]
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease Could not connect to security.debian.org:80 (149.20.4.14). - connect (111: Connection refused) [IP: 149.20.4.14 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
I can't even ping anything:
root#71136f0cb68d:/# ping google.ca
PING google.ca (172.217.12.227) 56(84) bytes of data.
And it freezes here.
But it works on ubuntu:
PS C:\me\docker-images> docker run --rm -it ubuntu
root#9d4717cf5a18:/# apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [80.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [626 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [439 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3759 B]
Get:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [255 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1002 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [808 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [18.8 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [5157 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [8075 B]
Fetched 25.2 MB in 9s (2642 kB/s)
Reading package lists... Done
Of course they are hitting different URLs, but I suspect that the debian server is online since I can reach it via web.
Why would my connection be limited on Debian but not on Ubuntu image?
I pulled the same image and tried, the ping and apt-get update worked fine.
Please restart the docker service and try again.
sudo service docker restart
Reference:
https://odino.org/cannot-connect-to-the-internet-from-your-docker-containers/
If you are using Docker Machine, you may want to try running:
docker-machine restart