slim icon indicating copy to clipboard operation
slim copied to clipboard

How to avoid healthcheck removal?

Open ammnt opened this issue 1 year ago • 3 comments

Expected Behavior

Slim utility compresses the image, but at the same time leaves healthcheck and the necessary dependencies for it.


Actual Behavior

Slim utility removes healthcheck and required dependencies for it (nc etc.).


Steps to Reproduce the Problem

  1. Buld the image from this Dockerfile: https://github.com/ammnt/nginx/blob/65baf28845c2ad1ee412ab8f0c6259af0dc6c601/Dockerfile
  2. Slim the image :)
  3. Then run the container and see that healthcheck is gone :(
  4. Inspect the image with Dive and confirm that all packages are gone too :(

Specifications

  • Version: slim version darwin/arm64|Transformer|1.40.11|latest|latest
  • Platform: macOS 14.3.1 (M1, arm64)

ammnt avatar Feb 26 '24 19:02 ammnt

it's a planned enhancement (hopefully in the next release... follow me on Github or Twitter to be notified when it's out). You can try to work around the current behavior using an 'exec' probe (with the --exec flag which you can use to invoke nc the same way the healthcheck instruction is configured).

kcq avatar Feb 28 '24 08:02 kcq

@ammnt this should take care of the healthcheck problem: https://github.com/mintoolkit/mint/releases/tag/1.41.1 Give it a try and let me know if you still have problems there.

kcq avatar Apr 06 '24 07:04 kcq

@kcq , awesome! Thank you so much! Can you explain me please how to use it with GitHub Actions? I can't find anything in documentation: https://github.com/ammnt/angie/blob/http3/.github/workflows/build.yml#L69

ammnt avatar Apr 06 '24 08:04 ammnt