Skip to content

Commit

Permalink
Added Gradle 4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr.Snowbird authored and Dr.Snowbird committed Oct 19, 2018
1 parent 98bcdf5 commit 889fb9b
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 11 deletions.
41 changes: 40 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

###################################
#### Install Java 11
###################################

#### ---------------------------------------------------------------
#### ---- Change below when upgrading version ----
#### ---------------------------------------------------------------
Expand Down Expand Up @@ -53,7 +56,9 @@ RUN curl -sL --retry 3 --insecure \
&& ln -s $JAVA_HOME $INSTALL_DIR/java \
&& rm -rf $JAVA_HOME/man jdk-${UPDATE_VERSION}_linux-x64_bin.tar.gz

###################################
#### Install Maven 3
###################################
ENV MAVEN_VERSION 3.5.4
ENV MAVEN_HOME /usr/apache-maven-$MAVEN_VERSION
ENV PATH $PATH:$MAVEN_HOME/bin
Expand All @@ -63,7 +68,41 @@ RUN curl -sL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binarie
| tar x -C /usr/ \
&& ln -s $MAVEN_HOME /usr/maven

#### define working directory.
###################################
#### ---- Pip install packages ----
###################################
COPY requirements.txt ./

## ---------------------------------------------------
## Don't upgrade pip to 10.0.x version -- it's broken!
## Staying with version 8 to avoid the problem
## ---------------------------------------------------

RUN pip3 install -r ./requirements.txt && pip3 install --upgrade pip

###################################
#### ---- Install Gradle ----
###################################
ARG GRADLE_INSTALL_BASE=${GRADLE_INSTALL_BASE:-/opt/gradle}
ARG GRADLE_VERSION=${GRADLE_VERSION:-4.9}

ARG GRADLE_HOME=${GRADLE_INSTALL_BASE}/gradle-${GRADLE_VERSION}
ENV GRADLE_HOME=${GRADLE_HOME}
ARG GRADLE_PACKAGE=gradle-${GRADLE_VERSION}-bin.zip
ARG GRADLE_PACKAGE_URL=https://services.gradle.org/distributions/${GRADLE_PACKAGE}
# https://services.gradle.org/distributions/gradle-4.9-bin.zip
RUN \
mkdir -p ${GRADLE_INSTALL_BASE} && \
cd ${GRADLE_INSTALL_BASE} && \
wget -c ${GRADLE_PACKAGE_URL} && \
unzip -d ${GRADLE_INSTALL_BASE} ${GRADLE_PACKAGE} && \
ls -al ${GRADLE_HOME} && \
ln -s ${GRADLE_HOME}/bin/gradle /usr/bin/gradle && \
${GRADLE_HOME}/bin/gradle -v

###################################
#### ---- Working directory. ----
###################################
RUN mkdir -p /data
COPY . /data

Expand Down
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Java JDK 11 + + Maven 3.5 + Python 3.5
# Java JDK 11 + Maven 3.5 + Python 3.5 + Gradle 4.10

##Components:
# License Agreement
By using this image, you agree the [Oracle Java JDK License](http://www.oracle.com/technetwork/java/javase/terms/license/index.html).
This image contains [Oracle JDK 11](http://www.oracle.com/technetwork/java/javase/downloads/index.html). You must accept the [Oracle Binary Code License Agreement for Java SE](http://www.oracle.com/technetwork/java/javase/terms/license/index.html) to use this image.

# Components:
Components:
* Oracle Java "11.0.1" JDK environment
java 11.0.1 2018-10-16 LTS
Expand All @@ -9,21 +13,22 @@ Components:

* Apache Maven 3.5.4
* Python 3.5.3
* Gradle 4.10
* Other tools: git wget unzip vim python python-setuptools python-dev python-numpy

## Pull the image from Docker Repository
# Pull the image from Docker Repository

```bash
docker pull openkbs/jdk11-mvn-py3
```

## Base the image to build add-on components
# Base the image to build add-on components

```Dockerfile
FROM openkbs/jdk11-mvn-py3
```

## Run the image
# Run the image

Then, you're ready to run:
- make sure you create your work directory, e.g., ./data
Expand All @@ -33,7 +38,7 @@ mkdir ./data
docker run -d --name my-jdk11-mvn-py3 -v $PWD/data:/data -i -t openkbs/jdk11-mvn-py3
```

## Build and Run your own image
# Build and Run your own image
Say, you will build the image "my/jdk11-mvn-py3".

```bash
Expand All @@ -47,13 +52,13 @@ mkdir ./data
docker run -d --name some-jdk11-mvn-py3 -v $PWD/data:/data -i -t my/jdk11-mvn-py3
```

## Shell into the Docker instance
# Shell into the Docker instance

```bash
docker exec -it some-jdk11-mvn-py3 /bin/bash
```

## Run Python code
# Run Python code

To run Python code

Expand Down Expand Up @@ -82,7 +87,7 @@ alias dpy3='docker run --rm openkbs/jdk11-mvn-py3 python3'
dpy3 -c 'print("Hello World")'
```

## Compile or Run java while no local installation needed
# Compile or Run java while no local installation needed
Remember, the default working directory, /data, inside the docker container -- treat is as "/".
So, if you create subdirectory, "./data/workspace", in the host machine and
the docker container will have it as "/data/workspace".
Expand Down Expand Up @@ -132,6 +137,20 @@ OS name: "linux", version: "4.15.0-36-generic", arch: "amd64", family: "unix"
Python 3.5.2
Python 3.5.2
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
------------------------------------------------------------
Gradle 4.10
------------------------------------------------------------
Build time: 2018-08-27 18:35:06 UTC
Revision: ee3751ed9f2034effc1f0072c2b2ee74b5dce67d
Kotlin DSL: 1.0-rc-3
Kotlin: 1.2.60
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 11.0.1 (Oracle Corporation 11.0.1+13-LTS)
OS: Linux 4.15.0-36-generic amd64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
Expand All @@ -147,4 +166,5 @@ SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
```
10 changes: 10 additions & 0 deletions docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@
# USER_ID=1000
# GROUP_ID=1000

###################################
#### ---- Java JDK ---- ####
###################################
# http://download.oracle.com/otn-pub/java/jdk/11.0.1+13/90cf5d8f270a4347a95050320eef3fb7/jdk-11.0.1_linux-x64_bin.tar.gz
JAVA_MAJOR_VERSION=11
JAVA_UPDATE_VERSION=0.1
JAVA_BUILD_NUMBER=13
JAVA_TOKEN=90cf5d8f270a4347a95050320eef3fb7

########################################
#### Rider configuration for run.sh ####
########################################
# - Use "#VOLUMES" and "#PORTS" to indicate that the variables for run.sh"
# - To ignore line, use "##" (double) in the beginning, e.g. "##VOLUMES" and "##PORTS"
# - To indicate that the variables for run.sh", use only one "#", e.g. "#VOLUMES" and "#PORTS"
#VOLUMES_LIST="data workspace"
##PORTS_LIST="18080:8000 17200:7200"
##PORTS_LIST="123:123/udp"

###################################
#### ---- Install Gradle ---- ####
###################################
GRADLE_INSTALL_BASE=/opt/gradle
GRADLE_VERSION=4.10
2 changes: 1 addition & 1 deletion printVersions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ python -V
python3 -V
#pip --version
pip3 --version
#gradle --version
gradle --version
cat /etc/*-release

11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pkgconfig
ipykernel
jupyter
Pillow
numpy
scipy
panda
pandasql
matplotlib
scikit_learn
Flask

0 comments on commit 889fb9b

Please sign in to comment.