The docker fails to start after the upgrade and needs to specify a storage driver

Problem Description:

When I had nothing to do, I executed sudo apt-get upgrade on the development computer to upgrade the software. After the upgrade, docker failed to start.

Use journalctl -xeu docker.service to view docker execution logs:

Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.351879912+08:00" level=warning msg="Base device already exists and has filesystem ext4 on it. User specified filesystem will be ignored." storage-driver=devicemapper
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.399328995+08:00" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.399328995+08:00" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information"
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.404671636+08:00" level=info msg="[core] [Channel #1] Channel Connectivity change to SHUTDOWN" module=grpc
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.404711920+08:00" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN" module=grpc
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.404731839+08:00" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel deleted" module=grpc
Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.404739619+08:00" level=info msg="[core] [Channel #1] Channel deleted" module=grpc
Mar 04 16:48:10 pop-os dockerd[39273]: failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/Mar 04 16:48:10 pop-os dockerd[39273]: failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information
Mar 04 16:48:10 pop-os systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit docker.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 04 16:48:10 pop-os systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Mar 04 16:48:10 pop-os systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 2047 and the job result is failed.
Mar 04 16:48:12 pop-os systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ Automatic restarting of the unit docker.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Mar 04 16:48:12 pop-os systemd[1]: Stopped Docker Application Container Engine.
░░ Subject: A stop job for unit docker.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support

Solution:

Find the key error information from the operation log:

Mar 04 16:48:10 pop-os dockerd[39273]: time="2023-03-04T16:48:10.399328995+08:00" level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/

The general meaning is that the previously used storage driver type devicemapper is not recommended for use now, and may be discarded in the future. What storage drivers are there now? You can click on the link given below to see for yourself. If you want to continue using devicemapper, you need to specify it explicitly. I want to make docker run now. First, find the corresponding configuration item storage-driver and add it to the /etc/docker/dameon.json file.

{
"data-root": "/data3/docker",
"storage-driver": "devicemapper"
}

After modification, docker can start normally

Guess you like

Origin blog.csdn.net/tianlangstudio/article/details/129337460