Docker & Containers (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What is the difference between `docker run`, `docker start`, `docker stop`, and `docker kill`?
junior LevelMost AskedDocker & Containers
In Simple Words:
docker run: Combinesdocker create(pulls image and allocates container layer) anddocker start(executes process). Spawns a brand new container instance.docker start: Starts an existing, stopped container without recreating its container filesystem layer.docker stop: Gracefully stops a running container. SendsSIGTERMto PID 1, waits a grace period (default 10 seconds) for clean shutdown (closing DB connections, flushing buffers), and sendsSIGKILLif the process fails to terminate.docker kill: Immediately terminates the container process by sendingSIGKILLdirectly without waiting for graceful cleanup.