Skip to content

Add Windows Dockerfiles for OracleJava #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2017
Merged

Add Windows Dockerfiles for OracleJava #209

merged 1 commit into from
Jan 4, 2017

Conversation

StefanScherer
Copy link
Contributor

This is a proposal of some Windows Dockerfiles for Oracle Java Server JRE just like the Linux variants.

You also have to download the server-jre-8u112-windows-x64.tar.gz manually and put it into the windows directory and run build.sh (I'm running this from my Mac talking to a Windows Docker engine in a VMware Fusion VM).

Output:

$ ./build.sh 
Sending build context to Docker daemon 56.31 MB
Step 1/4 : FROM microsoft/windowsservercore:latest
 ---> 93a9c37b36d0
Step 2/4 : ENV JAVA_PKG server-jre-8u112-windows-x64.tar.gz JAVA_HOME C:\\jdk1.8.0_112
 ---> Using cache
 ---> 90b91a9fa819
Step 3/4 : ADD $JAVA_PKG /
 ---> 6f17c4478b8f
Removing intermediate container 05346a0cb4bf
Step 4/4 : RUN setx /M PATH %PATH%;%JAVA_HOME%\bin
 ---> Running in eff4aa89c225

SUCCESS: Specified value was saved.
 ---> 44fb46479ea0
Removing intermediate container eff4aa89c225
Successfully built 44fb46479ea0
Sending build context to Docker daemon 56.31 MB
Step 1/4 : FROM microsoft/nanoserver:latest
 ---> 787d9f9f8804
Step 2/4 : ENV JAVA_PKG server-jre-8u112-windows-x64.tar.gz JAVA_HOME C:\\jdk1.8.0_112
 ---> Using cache
 ---> 2a771a3c444d
Step 3/4 : ADD $JAVA_PKG /
 ---> 7bf67b16f77f
Removing intermediate container 3bc245a3f50a
Step 4/4 : RUN setx /M PATH %PATH%;%JAVA_HOME%\bin
 ---> Running in b5d175f96985

SUCCESS: Specified value was saved.
 ---> 71b2e2fd4441
Removing intermediate container b5d175f96985
Successfully built 71b2e2fd4441
~/code/docker-images/OracleJava/java-8/windows on master
$ docker images
REPOSITORY                    TAG                   IMAGE ID            CREATED             SIZE
oracle/serverjre              8-nanoserver          71b2e2fd4441        4 seconds ago       1.07 GB
oracle/serverjre              8-windowsservercore   44fb46479ea0        14 seconds ago      8.845 GB
microsoft/nanoserver          latest                787d9f9f8804        11 days ago         918.3 MB
microsoft/windowsservercore   10.0.14393.321        93a9c37b36d0        7 weeks ago         8.675 GB
microsoft/windowsservercore   latest                93a9c37b36d0        7 weeks ago         8.675 GB
microsoft/nanoserver          10.0.14393.321        e14bc0ecea12        7 weeks ago         810.3 MB
~/code/docker-images/OracleJava/java-8/windows on master
$ docker run oracle/serverjre:8-nanoserver java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
~/code/docker-images/OracleJava/java-8/windows on master
$ docker run oracle/serverjre:8-windowsservercore java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

@StefanScherer StefanScherer changed the title Add Windows Dockerfiles Add Windows Dockerfiles for OracleJava Nov 15, 2016
@Djelibeybi
Copy link
Member

I have no issue with merging this as a sample/reference for Windows Docker users.

#
# - http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
#
e2fa735e6758e7c6bda43ba7cbaffe9c server-jre-8u112-linux-x64.tar.gz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't adjusted the checksum here as I don't know which sha type I should use or where to fetch the prebuilt checksum.

@StefanScherer
Copy link
Contributor Author

I added the sha256 sum and fixed the file name to download.

@brunoborges
Copy link
Contributor

#209 (comment)

I am ok with that too. But how about putting this under OracleJava/windows-java-8 instead?

@StefanScherer
Copy link
Contributor Author

If you prefer that directory, I can move it. I just started a similar directory structure as in https://github.com/docker-library/mongo/tree/master/3.2 or https://github.com/docker-library/golang.
With your suggestion it will be more visible.

@StefanScherer
Copy link
Contributor Author

I've moved the Windows Dockerfile and added samples for Java 7 as well. There is a problem ADDing the tar.gz of Java 7:

$ ./build.sh 
Sending build context to Docker daemon 90.07 MB
Step 1/4 : FROM microsoft/windowsservercore:latest
 ---> 93a9c37b36d0
Step 2/4 : ENV JAVA_PKG server-jre-7u80-windows-x64.tar.gz JAVA_HOME C:\\jdk1.7.0_80
 ---> Using cache
 ---> c38c57b17de4
Step 3/4 : ADD $JAVA_PKG /
open \\?\Volume{5d4d676d-a6d7-11e6-8367-000c291d792b}\jdk1.7.0_80\COPYRIGHT: The system cannot find the path specified.

So I added a step to extract all files and ADD the extracted folder instead, but only for Java 7.

Signed-off-by: Stefan Scherer <[email protected]>
@brunoborges
Copy link
Contributor

@StefanScherer, since this is a somewhat large contribution, can you please sign our OCA?

@brunoborges brunoborges added oca-required The PR requires the OCA to be signed (https://www.oracle.com/technetwork/community/oca-486395.html) java labels Nov 16, 2016
@StefanScherer
Copy link
Contributor Author

@brunoborges Sure, I'll do that.

@StefanScherer
Copy link
Contributor Author

@brunoborges I've send a photo of the signed OCA yesterday. Let me know if you need more.

@brunoborges
Copy link
Contributor

@StefanScherer mind to forward the email to me? bruno dot borges at oracle dot com

@StefanScherer
Copy link
Contributor Author

@brunoborges I've sent the OCA. Please let me know if you need more.

@brunoborges
Copy link
Contributor

@StefanScherer yeah I saw that already and working on it. Thx!

@brunoborges brunoborges merged commit 2f46e46 into oracle:master Jan 4, 2017
@StefanScherer StefanScherer deleted the add-windows-java-dockerfiles branch January 4, 2017 22:53
@StefanScherer
Copy link
Contributor Author

So as announced today in the keynote at DockerCon there now is a official image of Oracle Java SE for Linux. Will there be a Windows version soon? :-)

@brunoborges
Copy link
Contributor

We will look into that, but no idea when (or if) we will have something on the Store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oca-required The PR requires the OCA to be signed (https://www.oracle.com/technetwork/community/oca-486395.html)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants