krallin / tini

A tiny but valid `init` for containers
MIT License
9.66k stars 505 forks source link

How can I confirm that tini is running? #212

Closed bachmanity1 closed 1 year ago

bachmanity1 commented 1 year ago

I am using alpine image to run my java app, I've installed tini using the following:

RUN apk add --no-cache tini
# Tini is now available at /sbin/tini
ENTRYPOINT ["/sbin/tini", "--"]

when I run ps command inside my container I see that my java app is running as PID 1 however it is NOT prefixed with /sbin/tini -- so I'm not sure if tini is running or not.

Even when I use verbose option by changing entrypoint like:

ENTRYPOINT ["/sbin/tini", "-vvv", "--"]

container logs don't show any tini related messages, so it looks like entrypoint is ignored altogether which is really weird because I don't have any other entrypoint in my Dockerfile.

bachmanity1 commented 1 year ago

I'm sorry, I didn't know that in kubernetes command is equivalent to the Dockerfile's entrypoint and overrides it if defined. My image's default entrypoint was overrided by kubernetes' command and that's why ps didn't show that tini was running, after replacing command with args everything works fine.