0

Im, trying to build a container and need to install java8. all instructions are in the Dockerfile. System is 16.04.07 LTS. Error shows it's trying to download for focal release and I just don't get why

core@acme:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
core@acme:~$ 
core@acme:~$ 
core@acme:~$ 
core@acme:~$ docker-compose build
Building mongo...
Step 1/1 : FROM mongo:3.0.5
 ---> 960ec09b9ab6
Successfully built 960ec09b9ab6
Successfully tagged core_mongo:latest
Building voting...
Step 1/16 : FROM ubuntu
 ---> bb0eaf4eee00
Step 2/16 : RUN apt-get update
 ---> Using cache
 ---> 87abb253f7cf
Step 3/16 : RUN apt-get install -y software-properties-common
 ---> Using cache
 ---> 4b747dbd6cc8
Step 4/16 : RUN   echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&   add-apt-repository -y ppa:webupd8team/java &&   apt-get update &&   apt-get install -y oracle-java8-installer &&   rm -rf /var/cache/oracle-jdk8-installer
 ---> Running in 1dcc67a9c18a
Ign:1 http://ppa.launchpad.net/webupd8team/java/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Err:6 http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists...
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
Service 'alpha' failed to build: The command '/bin/sh -c echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&   add-apt-repository -y ppa:webupd8team/java &&   apt-get update &&   apt-get install -y oracle-java8-installer &&   rm -rf /var/cache/oracle-jdk8-installer' returned a non-zero code: 100
core@acme:~$ 
f0rd42
  • 101

1 Answers1

1

Your OS in docker is not the same as in your host system, your /etc/os-release file on your host does not matter.


This is what's happening:

Step 1/16 : FROM ubuntu

If you don't specify the version of a package in your Dockerfile, it loads the latest version (ubuntu:latest) from docker hub. And there, you can read:

The ubuntu:latest tag points to the "latest LTS", since that's the version recommended for general use.

So, currently this is focal.

To specify a version, you can change the line in your DOCKERFILE from

FROM ubuntu

to e.g.

FROM ubuntu:bionic

However, you have to find a different source for java, the PPA description says:

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

For this reason, THIS PPA IS DISCONTINUED.

pLumo
  • 26,947