Docker dm_task_run failed error

2020-05-17 04:35发布

Today I first time installed docker on Fedora 21. Now, I need change location of docker images folder from default /var/lib/docker.

After copying files (devicemapper subfolder skipped, docker service stopped) and changing /etc/sysconfig/docker (adding -g option), I run docker service again, no problems, devicemapper/metadata created.

Next, I'm trying to pull first image:

docker pull centos

But this error occured:

docker pull centos
latest: Pulling from docker.io/centos

6941bfcbbfca: Download complete 
6941bfcbbfca: Error downloading dependent layers 
41459f052977: Downloading [==========================>                        ] 41.61 MB/77.28 MB
fd44297e2ddb: Error pulling image (latest) from docker.io/centos, endpoint: https://registry-1.docker.io/v1/, Driver devicemapper failed to create image rootfs 6941bfcbbfca7f4f48becd38f2639157042bfd44297e2ddb: Error pulling image (latest) from docker.io/centos, Driver devicemapper failed to create image rootfs 6941bfcbbfca7f4f48becd38f2639157042b5cf9ab8c080f1d8b6d047380ecfc: Error running DeviceCreate (createSnapDevice) dm_task_run failed 
FATA[0013] Error pulling image (latest) from docker.io/centos, Driver devicemapper failed to create image rootfs 6941bfcbbfca7f4f48becd38f2639157042b5cf9ab8c080f1d8b6d047380ecfc: Error running DeviceCreate (createSnapDevice) dm_task_run failed 

If I try this without changing location - ok, no problems.

How to fix it?

标签: docker
5条回答
甜甜的少女心
2楼-- · 2020-05-17 05:09

As seen in issue 3721, this generally is a disk space issue.

The problem is that docker rmi doesn't always work in that case:

Getting this in v1.2 on CentOS 6.5 if a disk fills up before the image finishes pulling. Unable to rmi the incomplete image.

One "nuclear" option:

removing everything in /var/lib/docker worked out. Thanks

Another reason can be a common layer of fs to be downloaded between two images.

查看更多
戒情不戒烟
3楼-- · 2020-05-17 05:14

1) service docker stop

2) thin_check /home/docker/devicemapper/devicemapper/metadata

3) thin_check --clear-needs-check-flag /home/docker/devicemapper/devicemapper/metadata

4) service docker start

查看更多
欢心
4楼-- · 2020-05-17 05:17

Got this today.

sudo reboot

Problem's out.

查看更多
祖国的老花朵
5楼-- · 2020-05-17 05:21

This was worked for me,

mv -f /var/lib/docker/* /data/tmp
systemctl restart docker.service
docker system prune -a
查看更多
女痞
6楼-- · 2020-05-17 05:26

I encounter another dm_task_run issue during docker import, for my case, I yum erase docker.x86_64; yum install docker.x86_64; systemctl start docker.service works.

查看更多
登录 后发表回答