Run three containers that behave differently: one that prints and exits, one that runs your command, and a server that keeps running until you stop it.
Run the test image:
Run your own command in Alpine:
docker run alpine:3.20 echo "Hello from pier"Start nginx in the foreground with a name. The terminal stays attached to it:
docker run --name web nginx:1.27When the startup logs stop, press Ctrl+C.
Compare running containers with all containers:
docker ps
docker ps -a