Skip to content

Instantly share code, notes, and snippets.

@ykushch
Last active June 7, 2016 17:43
Show Gist options
  • Save ykushch/9afcf5a1e2c9ead0714b187c78c53ec8 to your computer and use it in GitHub Desktop.
Save ykushch/9afcf5a1e2c9ead0714b187c78c53ec8 to your computer and use it in GitHub Desktop.
Docker file to install base image and Java 8 image (Oracle). Also this script contains build.sh file to simplify build process.
#!/bin/bash
IMAGE_NAME=${PWD##*/}
docker build --no-cache -t dpcdata/${IMAGE_NAME} .
# image that solves PID 1 issue
FROM phusion/baseimage:0.9.17
# make sure that package repository is up to date
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt-get update && \
apt-get -y upgrade && \
locale-gen en_US.UTF-8
# install Java 8, telnet, wget
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 telnet wget && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Set correct environment variables.
ENV HOME /root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment