Created
February 24, 2017 18:23
-
-
Save teekaay/39bff8c66cd8e43c2ba57a6b2eef4fa8 to your computer and use it in GitHub Desktop.
Dockerfile for installing Java with Ubuntu base image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Java 8 (Oracle) Dockerfile | |
# Base image: Ubuntu | |
# Installs: Java 8 | |
FROM ubuntu:latest | |
# Install basic software support | |
RUN apt-get update && \ | |
apt-get install --yes software-properties-common | |
# Add the JDK 8 and accept licenses (mandatory) | |
RUN add-apt-repository ppa:webupd8team/java && \ | |
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections | |
# Install Java 8 | |
RUN apt-get update && \ | |
apt-get --yes --no-install-recommends install oracle-java8-installer | |
# Jetty/Tomcat port | |
# EXPOSE 8080 | |
# === Do your work here === | |
E: Unable to locate package software-properties-common
edit: after running apt-get update before apt-get install, I was able to install software-properties-common
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
E: Package 'oracle-java8-installer' has no installation candidate