title: How to Install/add jdk 7 in Docker Container
body: <p>I have created a docker image with Python as base in my Ubuntu 14.04 machine. Docker version I am using is 1.12.3. Base OS of Python used in image is Debian. I also require JAVA 7 (JDK 7) in my docker image. There are few Python scripts in it and also few scripts which requires JDK also.</p>
  
  <p>I was able to get JDK 7 in my image but from past few days it stopped working. It is throwing error that oracle-jdk-7 package is no more available. Then I tried to get JDK 7 Dockerfile content from Dockerhub and added those lines in my dockerfile. It worked couple of times and then it started throwing error that space is not sufficient. </p>
  
  <p>But space is not an issue as '/var' is only 29% occupied. Following is my Dockerfile content.</p>
  
  <pre><code>FROM python:2.7
  
  ENV http_proxy http://http.proxy.abc.com:8000
  ENV https_proxy http://http.proxy.abc.com:8000
  
  RUN \
    apt-get update &amp;&amp; \
    apt-get install -y openjdk-7-jdk &amp;&amp; \
    rm -rf /var/lib/apt/lists/*
  
  ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
  
  RUN pip install datetime &amp;&amp; \
  pip install pandas &amp;&amp; \
  pip install xlrd &amp;&amp; \
  pip install email &amp;&amp; \
  pip install Jinja2 &amp;&amp; \
  pip install bokeh==0.12.4
  </code></pre>
  
  <p>And I also tried following for jdk 7:</p>
  
  <pre><code>RUN    echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee /etc/apt/sources.list.d/webupd8team-java.list &amp;&amp; \
         echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list &amp;&amp; \
         apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 &amp;&amp; \
         apt-get update -qq &amp;&amp; \
         echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections &amp;&amp; \
         apt-get install oracle-java7-installer libxext-dev libxrender-dev libxtst-dev -y --no-install-recommends &amp;&amp; \
         apt-get clean autoclean &amp;&amp; \
         apt-get autoremove --yes &amp;&amp; \
         rm -rf /var/lib/{apt,dpkg,cache,log}/ &amp;&amp; \
        rm -rf /var/cache/oracle-jdk7-installer
  </code></pre>
  
  <p>This throws error that download is failed with 404 error and Oracle JDK 7 is not downloaded. This was working fine till few days back. </p>
  
  <p>I tried this also.</p>
  
  <pre><code>RUN \
    apt-get update &amp;&amp; \
    apt-get install -y openjdk-7-jdk &amp;&amp; \
    rm -rf /var/lib/apt/lists/*
  </code></pre>
  
  <p>This throws error that space is full. I see that '/var' is only 29% occupied.</p>
  
  <p>Tried this also.</p>
  
  <pre><code>RUN apt-get update &amp;&amp; \
      apt-get upgrade -y &amp;&amp; \
      apt-get install -y  software-properties-common &amp;&amp; \
      add-apt-repository ppa:webupd8team/java -y &amp;&amp; \
      apt-get update &amp;&amp; \
      echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections &amp;&amp; \
      apt-get install -y oracle-java8-installer &amp;&amp; \
      apt-get clean
  </code></pre>
  
  <p>This throws error that few packages are missing.</p>
  
  <p>Please help me getting jdk 7 in my docker image. Any JDK type would do. Oracle JDK or open jdk. </p>
  
  <p>Thanks in advance.</p>