For the time being, run the war file delivered in Java with Docker

background

I am running a .war file developed by another company, Currently, I started using Tomcat of EB, but I just wanted to make it Docker in consideration of quick operation check locally and ease of scaling.

I'll move it quickly

The goal is to write a Dockerfile and quickly complete a local Dockerfile.

Write a Dockerfile

FROM tomcat:8.5-jdk15-openjdk-slim

ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
WORKDIR $CATALINA_HOME

COPY sample.war webapps/sample.war

The version of tomcat is 8.5 series currently used and started for the time being. In tomcat, if you deploy the war file under webapps, it will be expanded automatically, so just set up tomcat and copy the war file.

to start

After that, hit the tag appropriately and start the container

$ docker build . -t sample:0.1
$ docker container run --name sample-container -p 80:8080 sample:0.1

After that, since the war file is expanded, access http: // localhost/{war file name} /

Recommended Posts

For the time being, run the war file delivered in Java with Docker
Run Dataflow, Java, streaming for the time being
[First Java] Make something that works with Intellij for the time being
Use Java external library for the time being
[Deep Learning from scratch] in Java 1. For the time being, differentiation and partial differentiation
[Java] Get the file path in the folder with List
Command to try using Docker for the time being
Hello World with Ruby extension library for the time being
[For beginners] Run Selenium in Java
Unzip the zip file in Java
Access Web API on Android with Get and process Json (Java for the time being)
Java14 came out, so I tried record for the time being
Introduction to java for the first time # 2
Read xlsx file in Java with Selenium
Learning for the first time java [Introduction]
Time shift measures with Docker for Windows
Java12 came out, so I tried the switch expression for the time being
Run Redmine in the local environment of Windows10 Pro-Use Docker Desktop for Windows
[Socket communication (Java)] Impressions of implementing Socket communication in practice for the first time
Programming for the first time in my life Java 1st Hello World
I tried using Docker for the first time
Read a string in a PDF file with Java
ChatWork4j for using the ChatWork API in Java
[Java] Set the time from the browser with jsoup
Feel the passage of time even in Java
Impressions and doubts about using java for the first time in Android Studio
I tried touching Docker for the first time
[Java] Read the file in src / main / resources
I want you to use Scala as Better Java for the time being
Install Amazon Corretto (preview) for the time being
Docker Container Operations with Docker-Client API for Java
Get along with Java containers in Cloud Run
How to save a file with the specified extension under the directory specified in Java to the list
A memo to do for the time being when building CentOS 6 series with VirtualBox
Form and process file and String data at the same time with Spring Boot + Java
[Tutorial] Download Eclipse → Run the application with Java (Pleiades)
Access the war file in the root directory of Tomcat
[Java] Check the JDK version of the built war file
Include image in jar file with java static method
A note for Initializing Fields in the Java tutorial
Learn for the first time java # 3 expressions and operators
[Java] Get the file in the jar regardless of the environment
Oreore certificate https (2020/12/19) for the first time with nginx
Try running Spring Cloud Config for the time being
Try connecting to AzureCosmosDB Emulator for Docker with Java
Learning memo when learning Java for the first time (personal learning memo)
Prepare the environment for java11 and javaFx with Ubuntu 18.4
Java11: Run Java code in a single file as is
Run Pico with docker
Run Payara with Docker
Copy and paste the file contents in Ubuntu's Docker container
Store in Java 2D map and turn with for statement
I translated [Clone method for Java arrays] as the Clone method in Java arrays.
Wait for the container service to start with docker healthcheck
Time is wrong with the application launched on the Docker container
About the behavior when doing a file map with java
Write DiscordBot to Spreadsheets Write in Ruby and run with Docker
With the software I've been making for a long time ...
Processing time measurement for each BCrypt + stretch count in Java
Modeling a Digimon with DDD for the first time Part 1
[Memo] Run Node.js v4.4.5 on CentOS 4.9 / RHEL4 (i386) for the time being (gcc-4.8 and glibc2.11 on LinuxKernel 2.6.9)