Skip to content
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

Ubuntu 17.04 #35

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
35 changes: 5 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
## Java Dockerfile


This repository contains **Dockerfile** of [Java](https://www.java.com/) for [Docker](https://www.docker.com/)'s [automated build](https://registry.hub.docker.com/u/dockerfile/java/) published to the public [Docker Hub Registry](https://registry.hub.docker.com/).


### Base Docker Image

* [dockerfile/ubuntu](http://dockerfile.github.io/#/ubuntu)


### Docker Tags

`dockerfile/java` provides multiple tagged images:

* `latest` (default): OpenJDK Java 7 JRE (alias to `openjdk-7-jre`)
* `openjdk-6-jdk`: OpenJDK Java 6 JDK
* `openjdk-6-jre`: OpenJDK Java 6 JRE
* `openjdk-7-jdk`: OpenJDK Java 7 JDK
* `openjdk-7-jre`: OpenJDK Java 7 JRE
* `oracle-java6`: Oracle Java 6 JDK
* `oracle-java7`: Oracle Java 7 JDK
* `oracle-java8`: Oracle Java 8 JDK

For example, you can run a `Oracle Java 8` container with the following command:

docker run -it --rm dockerfile/java:oracle-java8 java -version


### Installation

1. Install [Docker](https://www.docker.com/).

2. Download [automated build](https://registry.hub.docker.com/u/dockerfile/java/) from public [Docker Hub Registry](https://registry.hub.docker.com/): `docker pull dockerfile/java`

(alternatively, you can build an image from Dockerfile: `docker build -t="dockerfile/java" github.com/dockerfile/java`)
### Usage
cd oracle-java8
docker build -t uandrew1965/java-sdk:1.8.0.144-b01 . ##(1.8.0_144-b01 version java-sdk now)
docker run -it --name java-sdk-1.8.0.144-b01 uandrew1965/java-sdk:1.8.0.144-b01
java -version


### Usage
Expand Down
22 changes: 11 additions & 11 deletions oracle-java8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
#

# Pull base image.
FROM dockerfile/ubuntu
FROM ubuntu:17.04

# Install Java.
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/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils software-properties-common python-software-properties \
&& add-apt-repository ppa:webupd8team/java -y \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y oracle-java8-installer \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y oracle-java8-set-default \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/oracle-jdk8-installer


# Define working directory.
WORKDIR /data

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

# Define default command.
CMD ["bash"]
32 changes: 32 additions & 0 deletions oracle-java8/Dockerfile&
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Oracle Java 8 Dockerfile
#
# https://github.com/dockerfile/java
# https://github.com/dockerfile/java/tree/master/oracle-java8
#

# Pull base image.
FROM ubuntu:17.04

# Install Java.
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
apt-get update && \
apt-get install -y software-properties-common python-software-properties && \
add-apt-repository ppa:webupd8team/java -y && \
apt-get update && \

apt-get install -y oracle-java8-installer && \
apt-get install -y oracle-java8-set-default && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer


# Define working directory.
WORKDIR /data

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

# Define default command.
CMD ["bash"]