SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

The docker kill command

When running demos and experimenting with containers I always clear down my environment. It’s good practice to leave a clean environment once you’ve finished working.

To do this I blow all my containers away, usually by running the docker stop command.

But there’s a quicker way to stop containers, the docker kill command.

Time the difference for yourself: –

docker run -d -p 15789:1433 --env ACCEPT_EULA=Y --env SA_PASSWORD=Testing11@@ --name testcontainer microsoft/mssql-server-linux

First try the stop command: –

docker stop testcontainer

And then try the kill command: –

docker kill testcontainer

The kill command is pretty much instant right? But what’s the difference?

Well, according to the documentation, the stop command sends a SIGTERM signal to the main process within the container whereas the kill command sends a SIGKILL signal.

There’s a really good article here explaining the differences between the two signals but from what I can gather, the stop command gracefully shuts down the process within the container and the kill command just stops it dead.

Thanks for reading.


The DBA Who Came In From The Cold

I’m Andrew Pruski and I am a SQL Server DBA with 5 years experience in database development and administration.

The online SQL Server community has helped me out immensely throughout my career, whether from providing reference material in blog posts, or answering my (sometimes obscure) questions on forums. So, to try and say thank you, I would like to contribute my own experiences in the hope that they could benefit someone out there.

So here’s my general ramblings and thoughts about working as a SQL Server DBA.

You can find me on twitter @DBAFromTheCold

If you have any feedback on my blog please send me an email to dbafromthecold@gmail.com.

Comments

Leave a comment on the original post [dbafromthecold.com, opens in a new window]

Loading comments...