'Change docker storage engine from devicemapper to overlay2
I have 3 running containers in production. I have to move storage strategy to overlay2. I've committed my containers and I've saved these committed images as tar file.
Now I'm getting ready to remove all old docker stuff and then I'll change storage strategy.
Did anybody do this critical operation? Any suggestions to be in safe zone?
Solution 1:[1]
NOTE: You will lose access to all your current images and containers due to layers! Reverting your changes will make your old images and containers accessible again. You can use docker save IMAGE:TAG > IMAGE.tar.gz to save your current images and docker load < IMAGE.tar.gz to import them on the new storage driver.
Follow these steps:
Stop docker:
sudo systemctl stop docker
Edit the file /etc/docker/daemon.json (create it if doesn’t exist) and add the following to the file:
{
"storage-driver": "overlay2"
}
Start docker:
sudo systemctl start docker
Use docker info to verify that the storage driver is being used:
$ docker info
...
Storage Driver: overlay2
...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MSaadat |
