Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate package while building Docker image

During my Docker container build process, I attemptted to install a few packages using apt-get install. However the process failed to complete because the 3 of the 4 packages could not be found.

Step 1 : RUN apt-get update  && apt-get install -y netcat  ca-certificates  build-essential  libssl-dev
 ---> Running in 38d22d97ec4a
Err http://http.debian.net jessie InRelease

Err http://http.debian.net jessie-updates InRelease

Err http://security.debian.org jessie/updates InRelease

Err http://http.debian.net jessie Release.gpg
  Could not resolve 'http.debian.net'
Err http://security.debian.org jessie/updates Release.gpg
  Could not resolve 'security.debian.org'
Err http://http.debian.net jessie-updates Release.gpg
  Could not resolve 'http.debian.net'
Reading package lists...
W: Failed to fetch http://http.debian.net/debian/dists/jessie/InRelease

W: Failed to fetch http://http.debian.net/debian/dists/jessie-updates/InRelease 

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://http.debian.net/debian/dists/jessie/Release.gpg  Could not resolve 'http.debian.net'

W: Failed to fetch http://http.debian.net/debian/dists/jessie-updates/Release.gpg  Could not resolve 'http.debian.net'

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Could not resolve 'security.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package netcat
E: Unable to locate package build-essential
E: Unable to locate package libssl-dev
Removing intermediate container 38d22d97ec4a
2015/08/10 12:03:07 The command [/bin/sh -c apt-get update  && apt-get install -y netcat  ca-certificates  build-essential  libssl-dev] returned a non-zero code: 100

At first, I thought this was an issue with my base image, however I have no issues building the container on another VM. Thoughts?

like image 837
cmanning Avatar asked Jan 08 '23 19:01

cmanning


1 Answers

I found this answer in a newer question based on the same problem and it fixed the issue for me.

$ docker-machine restart default      # Restart the environment
$ eval $(docker-machine env default)  # Refresh your environment settings

Answer provided by Mark Smith.

like image 102
Bryce York Avatar answered Jan 10 '23 09:01

Bryce York