|
| 1 | +# Java visualizer backend using Oracle's Java 8 |
| 2 | + |
1 | 3 | # to build: |
2 | 4 | # docker build -t="pgbovine/cokapi-java:v1" . |
3 | 5 | # |
|
7 | 9 | # remember --rm or else stale old containers will be left around! |
8 | 10 | # use "docker ps -a" to see all containers |
9 | 11 |
|
10 | | -# don't use 'latest' tag since that might change |
11 | | -FROM ubuntu:14.04.1 |
| 12 | +# need to use at least 16.04 to get Java 8 |
| 13 | +FROM ubuntu:16.04 |
12 | 14 | MAINTAINER Philip Guo <philip@pgbovine.net> |
13 | 15 |
|
14 | 16 | # if apt-get doesn't work, then follow these instructions: |
15 | 17 | # http://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a |
16 | 18 | # Uncomment the following line in /etc/default/docker DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" |
17 | 19 | # Restart the Docker service sudo service docker restart |
18 | | -RUN apt-get update && apt-get install -y \ |
19 | | - openjdk-7-jdk |
| 20 | + |
| 21 | +# Follow these instructions for installing Oracle's official Java 8 |
| 22 | +# http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html |
| 23 | +RUN apt-get update && apt-get install -y software-properties-common |
| 24 | +RUN apt-add-repository ppa:webupd8team/java |
| 25 | +RUN apt-get update |
| 26 | +RUN yes | apt-get install -y oracle-java8-installer # pipe 'y' using 'yes' to agree to Oracle's terms of service for installer |
20 | 27 |
|
21 | 28 | RUN mkdir /tmp/java_jail |
22 | 29 | RUN mkdir /tmp/java_jail/cp |
23 | 30 | ADD java_jail/cp/ /tmp/java_jail/cp |
24 | 31 |
|
25 | 32 | # compile all Java files within cp/ |
26 | | -RUN cd /tmp/java_jail/cp && find . -name "*.java" -print | xargs javac -Xlint:unchecked -cp .:javax.json-1.0.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar |
| 33 | +RUN cd /tmp/java_jail/cp && find . -name "*.java" -print | xargs javac -Xlint:unchecked -cp .:javax.json-1.0.jar:/usr/lib/jvm/java-8-oracle/lib/tools.jar |
27 | 34 |
|
28 | 35 | COPY run-java-backend.sh /tmp/ |
29 | 36 | RUN chmod a+x /tmp/run-java-backend.sh |
|
0 commit comments