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:
sh
docker run alpine:3.20 echo "Hello from pier"Start nginx in the foreground with a name. The terminal stays attached to it:
sh
docker run --name web nginx:1.27When the startup logs stop, press Ctrl+C.
Compare running containers with all containers:
sh
docker ps
docker ps -a