user180574
user180574

Reputation: 6094

How to stop container within itself?

I am experimenting to let container terminate itself (for example, when it detects exception). But shutdown seems not working. Here is what I run inside the container.

$ sudo shutdown -h now
shutdown: Unable to shutdown system

Broadcast message from ...

The system is going down for halt NOW!

When hitting "Enter", it comes back.

Is it possible to do so?

Upvotes: 2

Views: 1264

Answers (1)

Javier Castellanos
Javier Castellanos

Reputation: 9894

The container stops once the entrypoint exits. If you entered in interactive mode just do ctrl + D.

Upvotes: 1

Related Questions