Following are the key points described later in this article:
Following is Dockerfile for creating Java8 image. Name the file as java8_base.df.
# Base is the Centos environment
FROM centos:centos6
# Make the directories under which Java 8 will get installed
RUN mkdir /opt/jdk
RUN cd /opt
# Install wget and tar which will be used to download and unzip Java8 files
RUN yum -y install wget tar
# Download the files
RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
# Unzip in /opt/jdk folder
RUN tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
# Set the path for Java and Javac
RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100
RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
Following scripts perform following two activities:
One may name the script as “startJava8.sh” and use it such as “startJava8.sh j8” where j8 is the name of the container. Make sure to put both of the above files, java8_base.df and start8Java.sh in the same folder.
#!/bin/sh
if [ $# == 0 ]; then
echo "This script expect container name argument. Example: ./installJava8.sh j8"
exit 100
fi
docker stop $1;docker rm $1
# Build Java8 image if it does not exists
#
j8_image="java8_base"
j8_df="java8_base.df"
if [ `docker images $j8_image | wc -l` -lt 2 ]; then
echo "Docker Image $j8_image do not exist..."
echo "Builing docker image $j8_image"
if [ -f $j8_df ]; then
docker build -t $j8_image -f $j8_df .
else
echo "Can't find Dockerfile $j8_df in the current location"
exit 200
fi
fi
docker run --privileged=true -ti -dP --name $1 -v /c/Users:/mnt/Users $j8_image /bin/bash
docker exec -ti $1 /bin/bash
Last updated: 25th Jan, 2025 Have you ever wondered how to seamlessly integrate the vast…
Hey there! As I venture into building agentic MEAN apps with LangChain.js, I wanted to…
Software-as-a-Service (SaaS) providers have long relied on traditional chatbot solutions like AWS Lex and Google…
Retrieval-Augmented Generation (RAG) is an innovative generative AI method that combines retrieval-based search with large…
The combination of Retrieval-Augmented Generation (RAG) and powerful language models enables the development of sophisticated…
Have you ever wondered how to use OpenAI APIs to create custom chatbots? With advancements…