We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question
0

Internet connection not working from within docker container

asked 2016-03-31 17:02:37 +0200

borgo gravatar image

Hello everyone,

we have problems building docker images on Fiware instance. The problem is, that from within a docker container, we can't download any data from internet. Commands like wget, composer, apt-get don't work. Strangely ping to any live address works fine from within containers.

My Dockerfile starts like this:

FROM php:7.0.4-apache
RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++
...
ADD entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

but the build fails...

Building web Step 1 : FROM php:7.0.4-apache
---> ce68d55b8d56
Step 2 : RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++
---> Running in 9108f4c9afcc
Ign http://httpredir.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates InRelease
Ign http://httpredir.debian.org jessie-updates InRelease
Get:1 http://httpredir.debian.org jessie-updates Release.gpg [1554 B]
Get:2 http://httpredir.debian.org jessie-updates Release.gpg [1554 B]
Err http://security.debian.org jessie/updates Release.gpg
Connection failed [IP: 195.20.242.89 80]
Err http://httpredir.debian.org jessie Release.gpg
Connection failed
Get:3 http://httpredir.debian.org jessie-updates Release.gpg [1554 B]

Same problems occurred when we uploaded existing container that works on different machines (Linode) to Fiware instance.

Internet connection from Instance itself works, just not from within a docker container.

Has anyone had the same issues with connectivity?

Thank you

edit retag flag offensive close merge delete

Comments

Have you tried checking the DNS configuration of the container? http://odino.org/cannot-connect-to-the-internet-from-your-docker-containers/

Eddy gravatar imageEddy ( 2016-04-04 13:36:04 +0200 )edit

Thanks. We have tried changing DNS provider before and now again following your tip. Didn't help, pinging works but nothing else. When we deploy the same docker container to Linode, it works. So we think it's something Fiware related. Thanks.

borgo gravatar imageborgo ( 2016-04-05 17:08:10 +0200 )edit

I tried to reproduce on a FIWARE instance with a docker engine, but it had no problem with the apt-get install. What happens when you do the same apt-get on the docker host? --Ken

knagin gravatar imageknagin ( 2016-04-06 13:38:50 +0200 )edit

This fixed it for us: https://rahulait.wordpress.com/2016/02/28/modifying-default-mtu-for-docker-containers/ That's for debian 8 image, we had to switch from ubuntu.

borgo gravatar imageborgo ( 2016-04-19 13:44:12 +0200 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2016-04-21 16:55:43 +0200

Miguel Carrillo gravatar image

I guess that this question is then answered in the comments! Thanks for approaching us.

edit flag offensive delete link more

Comments

I am trying to deploy fiware docker container on openstack instance and facing the same issue,giving connection falied error on executing apt-get update line of dockerfile. Step 3/19 : RUN apt-get update Err http://deb.debian.org jessie Release.gpg Connection failed [IP: 151.101.8.204 80]

Adeeb gravatar imageAdeeb ( 2018-03-12 09:05:03 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-03-31 17:02:37 +0200

Seen: 25,728 times

Last updated: Apr 21 '16