Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmyth committed Jul 18, 2017
1 parent 6faede5 commit de729cb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# AlpineLinux for the raspberry pi 3, with glibc-2.23 and Oracle Java 8
# Based on https://github.com/anapsix/docker-alpine-java, for x86_64

FROM resin/raspberrypi3-alpine:3.6

MAINTAINER Don Smyth <dsmyth@signett.com>

# Java Version and other ENV
ENV JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=141 \
JAVA_VERSION_BUILD=15 \
JAVA_PACKAGE=server-jre \
JAVA_JCE=standard \
JAVA_HOME=/opt/jdk \
PATH=${PATH}:/opt/jdk/jre/bin \
GLIBC_VERSION_MAJOR=2.22 \
GLIBC_VERSION=2.22-r8 \
LANG=C.UTF-8

# do all in one step
RUN set -ex && \
apk upgrade --update && \
apk add --update libstdc++ curl ca-certificates bash && \
for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION} glibc-i18n-${GLIBC_VERSION}; do curl -sSL https://github.com/armhf-docker-library/alpine-pkg-glibc/releases/download/${GLIBC_VERSION_MAJOR}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
apk add --allow-untrusted /tmp/*.apk && \
rm -v /tmp/*.apk && \
( /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true ) && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \
mkdir -p /opt && \
curl -jksSLH "Cookie:oraclelicense=accept-securebackup-cookie" -o /tmp/java.tar.gz \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/336fa29ff2bb4ef291e347e091f7f4a7/jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-arm32-vfp-hflt.tar.gz && \
tar -C /tmp -xvzf /tmp/java.tar.gz && \
mkdir -p /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} && \
mv /tmp/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}/jre /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} && \
ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk && \
apk del curl glibc-i18n && \
rm -rf \
/tmp/* /var/cache/apk/* && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf

# EOF
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# docker-alpine-java-rpi
Docker image using alpine linux supporting Oracle Java JRE 8

Built for use with resin.io -- I found that the OpenJDK versions were way too slow.

This is jre only -- to get full jdk, edit the Dockerfile to extract the full tarball in /opt, rather than extracting in /tmp and moving the jre to /opt.

You can find the Docker image at docker.io/dpsmyth/docker-alpine-java-raspberrypi3

0 comments on commit de729cb

Please sign in to comment.