Stop, Start, and Remove Containers
Published: Aug 24, 2026
I’ve covered a lot of the creation and usage of a Container, but it’s very unusual that you’d want to create one, get it running, and then leave it that way.
Generally you want to stop and start the Container on demand, and eventually you’ll want to remove it entirely.
Therefore let’s have a look at that.
This is actually nice and easy (most things in Docker are once you’re used to the syntax and the nuances).
Let’s imagine we’ve run all of our previous blog demos and therefore we have a Container called SQL2019Linux and it’s currently running and with the AdventureWorks2012 database on it.
We now want to shut it down as it’s not needed at the moment, but we’ll keep the Container alive as we are likely to want to test something again in the coming days.
So we simply STOP the Container:
We’ve decided we now want to boot it back up again to test something, so we simply start it again:
This will now allow us to connect to our SQL Server again and all settings and disks etc will remain intact. Therefore it still has AdventureWorks and it still has any settings we may have put into place.
It’s almost like Shutting down and Starting the SQL Server Service on an installed instance.
Once we’re done with the Container and we’re happy that we don’t want any data and can destroy it (kind of like uninstalling a program from a desktop and stating remove all user settings), which we can do with “Remove”:
We can then check it’s gone by looking at a list of all Containers in our Docker Desktop:
You can see there are no Containers listed at all.
Just for reference and completeness, this is what it looks like when there are Containers present:
Generally you want to stop and start the Container on demand, and eventually you’ll want to remove it entirely.
Therefore let’s have a look at that.
This is actually nice and easy (most things in Docker are once you’re used to the syntax and the nuances).
Let’s imagine we’ve run all of our previous blog demos and therefore we have a Container called SQL2019Linux and it’s currently running and with the AdventureWorks2012 database on it.
We now want to shut it down as it’s not needed at the moment, but we’ll keep the Container alive as we are likely to want to test something again in the coming days.
So we simply STOP the Container:
We’ve decided we now want to boot it back up again to test something, so we simply start it again:
This will now allow us to connect to our SQL Server again and all settings and disks etc will remain intact. Therefore it still has AdventureWorks and it still has any settings we may have put into place.
It’s almost like Shutting down and Starting the SQL Server Service on an installed instance.
Once we’re done with the Container and we’re happy that we don’t want any data and can destroy it (kind of like uninstalling a program from a desktop and stating remove all user settings), which we can do with “Remove”:
We can then check it’s gone by looking at a list of all Containers in our Docker Desktop:
You can see there are no Containers listed at all.
Just for reference and completeness, this is what it looks like when there are Containers present: