Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot (apt-get) install packages inside docker

I installed ubuntu 14.04 virtual machine and run docker(1.11.2). I try to build sample image (here).

docker file :

FROM java:8 

# Install maven
RUN apt-get update  
RUN apt-get install -y maven
....

I get following error:

Step 3: RUN apt-get update
 --> Using cache
 --->64345sdd332
Step 4: RUN apt-get install -y maven
 ---> Running in a6c1d5d54b7a
Reading package lists...
Reading dependency tree...
Reading state information...
E: Unable to locate package maven
INFO[0029] The command [/bin/sh -c apt-get install -y maven] returned a non-zero code:100

enter image description here

following solutions I have tried, but no success.

  1. restarted docker here

  2. run as apt-get -qq -y install curl here :same error :(

how can i view detailed error message ? a any way to fix the issue?

like image 622
Paraneetharan Saravanaperumal Avatar asked Jul 04 '16 08:07

Paraneetharan Saravanaperumal


1 Answers

you may need to update os inside docker before

try to run apt-get update first, then apt-get install xxx

like image 101
Alongkorn Avatar answered Oct 11 '22 11:10

Alongkorn