Docker Community Forums

Share and learn in the Docker community.

Yum not working inside docker


(Teldasoft) #1

Hi all,

I have a very strange problem.
I have my openstack configured, inside two instances running, both are connected to the same network, etc.
On both instances I have docker binaries installed (with version 17.06.2-ce).
On first instance (Ubuntu 16.04, m1.medium) I have sample Dockerfile which is:

FROM centos:centos6.6
MAINTAINER Test
RUN yum -y update

and when I perform the build like:
sudo docker build .

everything works fine.

On the second instance (Ubuntu 16.04, d1.large) I have same Dockerfile as above.
After performing same build comment I get:

Sending build context to Docker daemon 3.072kB
Step 1/3 : FROM centos:centos6.6
—> 21edfae4b8fd
Step 2/3 : MAINTAINER Test
—> Running in 12280eeda66d
—> 5242da5c06d0
Removing intermediate container 12280eeda66d
Step 3/3 : RUN yum -y update
—> Running in 9f2d386f0d0b
Loaded plugins: fastestmirror
Setting up Update Process
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn’t resolve host ‘mirrorlist.centos.org’"
The command ‘/bin/sh -c yum -y update’ returned a non-zero code: 1

Can anyone tell me what the problem is? I compared almost everything on those both instances, starting from /etc/resolv.conf, etc.
yum works with Docker on instance1 but not on instance2.
Can anyone advice me where the problem can be?
I would be very appreciated.
Thanks great for any hints.

Marcin