docker stop mynginx
Additionally, the container id can also be used to stop the container instead of its name.
This will stop a running container by sending the SIGTERM signal and then the SIGKILL signal if necessary.
Further, the kill command can be used to immediately send a SIGKILL or any other specified signal using the
docker kill mynginx
docker kill -s SIGINT mynginx
Stopping a container doesn't delete it. Use
docker ps -a to see your stopped container.