steve icon indicating copy to clipboard operation
steve copied to clipboard

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

Open MingShyanWei opened this issue 1 year ago • 3 comments

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.

MingShyanWei avatar Oct 28 '24 05:10 MingShyanWei

Duplicate of #1319

juherr avatar Oct 28 '24 07:10 juherr

@MingShyanWei thanks for this!

@juherr what to do about the other PR? it is still a draft. which one should be accept?

goekay avatar Dec 15 '24 10:12 goekay

@goekay It was in draft because waiting for tests/feedbacks. It should work but I didn't test on my own side yet. I can do it soon or feel free to merge if it is working for you.

juherr avatar Dec 15 '24 10:12 juherr

i updated this PR (since it was more recent) with some inspiration from https://github.com/steve-community/steve/pull/1319

therefore, this one supersedes it.

goekay avatar Sep 17 '25 08:09 goekay