oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.55k stars 5.43k forks source link

OracleJava 8 server-jre build.sh FAILED #2632

Closed ducknificient closed 1 year ago

ducknificient commented 1 year ago

Hi, i tried to build Oracle JDK (Server JRE) base image for Oracle WebLogic. But it's failed on step 8 upon validating checksum . I tried various versions of server-jre from 8u92 to 8u202. Download source is from https://www.oracle.com/id/java/technologies/javase/javase8-archive-downloads.html Thank you

Building Oracle Server JRE 8 on Oracle Linux 7 slim
Sending build context to Docker daemon  59.89MB
Step 1/14 : FROM oraclelinux:7-slim as builder
 ---> c2ad9d6aa2df
Step 2/14 : LABEL maintainer="Aurelio Garcia-Ribeyro <aurelio.garciaribeyro@oracle.com>"
 ---> Running in bf864f2112f8
Removing intermediate container bf864f2112f8
 ---> 9ad8d7464db6
Step 3/14 : RUN yum install -y gzip tar
 ---> Running in 7c5b52bce569
Loaded plugins: ovl
Package 2:tar-1.26-35.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gzip.x86_64 0:1.5-11.el7_9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package       Arch            Version                Repository           Size
================================================================================
Installing:
 gzip          x86_64          1.5-11.el7_9           ol7_latest          129 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 129 k
Installed size: 245 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gzip-1.5-11.el7_9.x86_64                                     1/1 
  Verifying  : gzip-1.5-11.el7_9.x86_64                                     1/1 

Installed:
  gzip.x86_64 0:1.5-11.el7_9                                                    

Complete!
Removing intermediate container 7c5b52bce569
 ---> 1ec6efe41ec1
Step 4/14 : ENV LANG en_US.UTF-8
 ---> Running in fe0bb5af700a
Removing intermediate container fe0bb5af700a
 ---> 42f4b7a41f76
Step 5/14 : ENV JAVA_HOME=/usr/java/jdk-8
 ---> Running in 935f93f1ff93
Removing intermediate container 935f93f1ff93
 ---> dbbb5fbbfbbb
Step 6/14 : COPY server-jre-8u*-linux-x64.tar.gz /tmp/jdk.tgz
 ---> fbf47bea986c
Step 7/14 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Running in cb6e8690dfca
Removing intermediate container cb6e8690dfca
 ---> 2e155eff11db
Step 8/14 : RUN set -eux;   JAVA_SHA256=9be0abcb22e01fb63efe7926b1b174082a325dff2bec12604cf776012a5be003 ;  echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c -; mkdir -p "$JAVA_HOME";  tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1;
 ---> Running in 1c45387206c9
+ JAVA_SHA256=9be0abcb22e01fb63efe7926b1b174082a325dff2bec12604cf776012a5be003
+ echo '9be0abcb22e01fb63efe7926b1b174082a325dff2bec12604cf776012a5be003 */tmp/jdk.tgz'
+ sha256sum -c -
sha256sum: WARNING: 1 computed checksum did NOT match
/tmp/jdk.tgz: FAILED
The command '/bin/bash -o pipefail -c set -eux;     JAVA_SHA256=9be0abcb22e01fb63efe7926b1b174082a325dff2bec12604cf776012a5be003 ;  echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c -;     mkdir -p "$JAVA_HOME";  tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1;' returned a non-zero code: 1
Djelibeybi commented 1 year ago

@aureliogrb @mriccell could you please look into this?

aureliogrb commented 1 year ago

The dockerfile for server jre has hardcoded the checksum for the current version of the JRE and it explains in the instructions (comment section in the top) to download the server jre from https://www.oracle.com/java/technologies/downloads/ rather than from archive pages.

This is called out in the error you see: "WARNING: 1 computed checksum did NOT match"

The versions that you tried: 8u92 to 8u202 from 2016-04-19 to 2019-01-15 are grossly out of date.

I would strongly advice against using an out-of-date server jre for anything other than debugging an old system in a very controlled environment. To give you an example of why: TLS 1.3 was added to JDK 8 in 2020 (8u271). The versions you were trying to use top out at TLS 1.2. Older versions are also vulnerable to security vulnerabilities fixed and disclosed that might cause you grief.

If you do have a good reason to do it (and strong isolation to secure your system) you can edit the checksum in the docker file to match the checksum of the version you want to install.