Containers are not VMs, they are just an isolation layer. If you shut down the main process in a container, the container will terminate.
The usual “hacks” to keep a container running is using a shell loop or sleep as main process. You can then usually use docker exec -it <c-id> sh to run something in container.