Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dockerfile for k8s mvnw Not Found Error , Optimize Image Size with Multi-Stage Build and SERVER_HOST #1611

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MingShyanWei
Copy link

This PR introduces three main improvements to the Dockerfile:

  1. Fix Dockerfile Errors:
  • Added the following lines to ensure that the Maven Wrapper (mvnw) and the Maven directory (.mvn) are included in the image during the build process.
  1. Optimized Dockerfile with Multi-Stage Build:
  • Refactored the Dockerfile to utilize a multi-stage build process. This separates the build and release stages, which helps to reduce the final image size by including only the necessary files in the runtime image.
  1. Introduce SERVER_HOST Environment Variable:
  • Added a new environment variable SERVER_HOST to allow configuration of the server's bind address. This will enhance flexibility in deployment scenarios.


# Make the Maven wrapper executable
RUN chmod +x mvnw
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fixed directly into the sources

@juherr
Copy link
Contributor

juherr commented Oct 28, 2024

Duplicate of #1319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants