What command stops a container?

To stop a running container in Podman, you can use the podman stop command followed by the container name or ID. Here’s the syntax:

podman stop <container_name_or_id>

Example

If you have a container named my_container, you would stop it with:

podman stop my_container

You can also use the container ID instead of the name:

podman stop <container_id>

This command sends a SIGTERM signal to the container, allowing it to shut down gracefully. If the container does not stop within a default timeout period (10 seconds), it will be forcibly terminated. You can specify a different timeout by adding a number (in seconds) after the container name or ID:

podman stop -t 20 my_container

This example sets a timeout of 20 seconds before forcibly stopping the container.

0 Comments

no data
Be the first to share your comment!