Sign inSign up

yanixdo/java_multistage

By yanixdo

•Updated over 1 year ago

A flexible Java Docker image with Maven for building and running applications.

Image
Languages & frameworks
Integration & delivery
Developer tools
0

74

yanixdo/java_multistage repository overview

⁠Java_simpleapp

Python Docker

ā šŸ“‹ Description

java_simpleapp is a lightweight Java application designed as an example of how to build and run Java projects using Docker and Maven. This project demonstrates a simple "Hello, World!" application, packaged in a multi-stage Docker build to ensure efficiency and scalability.

ā šŸš€ Start of work

⁠1. Clone the repository
git clone https://github.com/YanaDevOps/java_simpleapp.git
cd java_simpleapp
⁠2. Build and run the container
docker build -t java_simpleapp:1.0.0 .
docker run --rm java_simpleapp:1.0.0
⁠3. Expected output

When you run the container, the following message will be displayed:

Hello, World from Docker!

ā šŸ“‚ Project structure

java_simpleapp/
ā”œā”€ā”€ Dockerfile
ā”œā”€ā”€ pom.xml
└── src/
    └── main/
        └── java/
            └── com/
                └── example/
                    └── App.java
  • Dockerfile: Configuration file for creating a multi-stage Docker image.
  • pom.xml: Maven configuration file for building the Java project.
  • App.java: Main Java application that outputs "Hello, World from Docker!".

⁠🌟 Functionality

  • Multi-Stage Build: Optimized Dockerfile for building and running Java applications.
  • Lightweight JRE Image: Uses JRE instead of JDK in the final stage for reduced image size.
  • Hello, World Application: Simple application demonstrating Java with Docker and Maven integration.

ā šŸ’» Technology

  • Java 11
  • Maven
  • Docker

ā šŸ‘¤ Author

Name: Yana Lysenko

GitHub: YanaDevOps⁠

Tag summary

Content type

Image

Digest

sha256:29b2da27a…

Size

116.8 MB

Last updated

over 1 year ago

docker pull yanixdo/java_multistage:1.0