Why sleep in container isn't get stopped?

Hi everyone,

I’m looking for an answer for a question why I can’t stop container with sleep running.

Eg. call

docker container run --rm ubuntu sleep 30s

It gets killed due to the stop timeout. Could you please explain why this behaviour occurs? I would expect that sleep should be stopped properly with SIGTERM. I managed to get to this weird for me behaviour while studying exec command while using scripts.

Sorry if this is bad category, if so please move to the preferred one.

Kind Regards,
Mati

Ok, I think that I’ve found the explanation of this weird behaviour here https://superuser.com/questions/1299461/how-can-i-stop-a-docker-container-running-sleep

However, when running with PID = 1, unhandled signals are ignored, otherwise you’d end up with a kernel panic