• LOGIN
  • No products in the cart.

DevOps on AWS – Docker Image File for Java

Docker File:

# Ubuntu with Java 8 installed.

FROM ubuntu
MAINTAINER G venkat g.venkat09@gmail.com
RUN apt-get update &&
    apt-get upgrade -y &&
    apt-get install -y  software-properties-common &&
    add-apt-repository ppa:webupd8team/java -y &&
    apt-get update &&
    echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections &&
    apt-get install -y oracle-java8-installer &&
    apt-get clean




Cmds:

Java Docker File:
docker build -f Dockerfile -t rns/oracle-java:8 .

To compile your Main.java file.
$ docker run –rm -v $PWD:/app -w /app rns/oracle-java:8 javac Main.java

To run your compiled Main.class file.
$ docker run –rm -v $PWD:/app -w /app rns/oracle-java:8 java Main
February 22, 2021

0 responses on "DevOps on AWS - Docker Image File for Java"

    All rights reserved.
    error: Alert: Content is protected !!
    X