What if you manage your Java application environment with Kubernetes? First, build the development environment in a container to answer
The functions are as follows Java
You will be able to create a development environment from a Dockerfile. Even if you do not want to publish the configuration information locally or in a dedicated development environment, you can create the same environment anywhere by sharing the Dockerfile.
Docker installed Mac
First of all, preliminary research "Something" features like Java containers and ssh connection settings should have been accomplished by great men!
First, search on Docker Hub https://hub.docker.com/
I didn't have a good one, so I decided to make it from Dockerfile.
To home directory
cd
Open a terminal and create a working folder
mkdir myproject
Go to working folder
cd myproject
Create a Dockerfile
vi Dockerfile
Dockerfile
FROM ubuntu:latest
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer
CMD "/bin/bash"
Generate image from Dockerfile
docker build -t testtest .
Don't forget the last "."
After a short time
Successfully built 51fe1ec9021b Successfully tagged test:latest
There is a display like this, and the image is finished.
Make sure the image exists
docker images
A list of owned images is output, and if there is "testtest", it is OK
Run the image
docker run -i -t testtest java -version
OK if the output is as follows
java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Thank you for your hard work.
Recommended Posts