Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6015

Docker Image Build Strange Behavior With Network Access

$
0
0

I'm trying to build an Ubuntu based docker image. I'm using Pop_OS as the host OS. My Docker versions are up to date.My /etc/docker/daemon.json file contains:

{"dns": ["8.8.8.8", "8.8.4.4"]}

Basic MVC for the Ubuntu Dockerfile

FROM ubuntu:latestRUN apt-get install build-essential

and issuing docker build . ends up with

0.210 E: Unable to locate package build-essential------Dockerfile:2--------------------   1 |     FROM ubuntu:20.04   2 | >>> RUN apt-get install build-essential   3 |     --------------------ERROR: failed to solve: process "/bin/sh -c apt-get install build-essential" did not complete successfully

removing the apt install line, and inspecting the /etc/resolv.conf in the container shows

root@0a3c00aaaae0:/# cat /etc/resolv.conf nameserver 127.0.0.11options ndots:0

Changing the Dockerfile to

FROM alpine:latestRUN apk add curl

and running docker build . is successfuland inspecting the /etc/resolv.conf shows

$ docker exec -it <container> /bin/sh/ # cat /etc/resolv.conf nameserver 127.0.0.11options ndots:0

but instead of having no access to the network, I'm able to ping google and interact as expected.

Does anyone have any clues as to what is causing this?


Viewing all articles
Browse latest Browse all 6015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>