Can Docker Containers maintan state between restarts? Can Docker Containers maintan state between restarts? docker docker

Can Docker Containers maintan state between restarts?


Yes they can if you don not delete the container so you can

docker stop xxx

or just simply restart your machine and than use

docker start xxx

or

docker restart xxx

if you use docker run you create a new container so there is no previous state to talk about. For sql server specifically there is an option to create a volume and store data there. If you do that you can delete a container and recreate it again without loosing data as its is no longer stored inside it.