Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker installation debian openjdk-7-jre

I've been trying to install openjdk-7-jre in a docker image. But when I tried to install it I got the following error:

E: Failed to fetch http://security.debian.org/pool/updates/main/o/openjdk-7/openjdk-7-jre-headless_7u111-2.6.7-2~deb8u1_amd64.deb Connection failed [IP: 200.17.202.197 80]

I've been spending a lot of hours trying this. For More details, the instruction in the Dockerfile is:

RUN apt-get update -qq && apt-get install -y -f xvfb wget 
RUN sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list && \
    apt-get update -qq && \
    apt-get install --fix-missing -y -f openjdk-7-jre

RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    dpkg --unpack google-chrome-stable_current_amd64.deb && \
    apt-get install -f -y && \
    apt-get clean && \
    apt-get update && \
    rm google-chrome-stable_current_amd64.deb

RUN npm install -g protractor mocha jasmine cucumber && \
    webdriver-manager update && \
    apt-get update

What am I doing wrong?

like image 804
Gonzalo Pincheira Arancibia Avatar asked Nov 14 '16 01:11

Gonzalo Pincheira Arancibia


2 Answers

This is because you are getting an error in the second RUN command, apt-get update -qq. The error is getting buried because of -qq flag (which will quite the error messages. Try without -qq to diagnoise the error)

enter image description here

You can try using below Dockerfile for installing openjdk-7-jre.

FROM ubuntu

RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa 
RUN apt-get update 
RUN apt-get install --fix-missing -y -f openjdk-7-jre
like image 67
Penkey Suresh Avatar answered Oct 19 '22 15:10

Penkey Suresh


just added FROM debian:jessie to your dockerfile and successfully built the image. Your problem is your internet connection, Use VPN or Proxy servers to build the image.

like image 1
Farhad Farahi Avatar answered Oct 19 '22 14:10

Farhad Farahi