Globally, Docker containers should be stateless. It means that they shouldn’t store any state, any data. Of course, for some containers, we need to save data, for example for databases, but not only. For that, we use volumes. A best practice is to use data containers to make independant the containers from the location of the volumes.