Skip to content

Document Kubernetes preStop handler when using a Docker image without a shell #43830

Closed
@andrej-urvantsev

Description

@andrej-urvantsev

Or, maybe, not exactly inconsistency but now it's a bit misleading...

In the Kubernetes Container Lifecycle there is a suggestion to use preStop handler like this: command: ["sh", "-c", "sleep 10"]

Problem is that by default Spring Boot paketo images from now on use paketobuildpacks/builder-jammy-java-tiny image, which does not have any shell.

So, either a new recipe should be suggested or a word of warning should say that for default spring boot images that won't work anymore.

As a suggestion - maybe include "sleep" command into the image, so something like this would work?

lifecycle:
  preStop:
    exec:
      command:
        - sleep
        - 60

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions