Ask Your Question
1

How can I switch the docker storage engine from devicemapper to overlay2?

asked 2021-08-05 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-06-10 12:00:00 +0000

qstack gravatar image

To switch the Docker storage engine from devicemapper to overlay2, follow these steps:

  1. Stop the Docker daemon:
sudo systemctl stop docker
  1. Check the current storage driver by running the following command:
docker info | grep "Storage Driver"
  1. If the output shows "devicemapper," backup any existing Docker data by moving it to a new directory:
sudo mv /var/lib/docker /var/lib/docker.bak
  1. Install the packages required for overlay2:
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install docker-ce
  1. Edit the Docker daemon configuration file:
sudo vim /etc/docker/daemon.json
  1. Add the following lines to the file:
{
  "storage-driver": "overlay2"
}
  1. Save and close the file.

  2. Start the Docker daemon:

sudo systemctl start docker
  1. Verify that the storage driver has been changed to overlay2:
docker info | grep "Storage Driver"

The output should show "overlay2."

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-05 11:00:00 +0000

Seen: 16 times

Last updated: Jun 10 '22