我用的环境是CentOS 6.5 x64, docker-io-1.1.2-1版本.
docker-io包来自EPEL,
docker-io 包的内容如下:
/var/lib/docker 应该是存放本地image的目录. 在pull期间, 我只是du -sh了这个目录, 导致了pull失败, 如下 :
运行这个image, 因为本地没有这个image, 所以会自动下载 :
删除image
再次运行依然失败, 说明问题不在image
重启服务器, 再次pull, run成功.
[参考]
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
docker-io 包的内容如下:
[root@150 ~]# rpm -ql docker-io
/etc/bash_completion.d
/etc/bash_completion.d/docker.bash
/etc/rc.d/init.d/docker
/etc/sysconfig/docker
/etc/udev/rules.d
/etc/udev/rules.d/80-docker.rules
/usr/bin/docker
/usr/libexec/docker
/usr/libexec/docker/dockerinit
/usr/share/doc/docker-io-1.1.2
/usr/share/doc/docker-io-1.1.2/AUTHORS
/usr/share/doc/docker-io-1.1.2/CHANGELOG.md
/usr/share/doc/docker-io-1.1.2/CONTRIBUTING.md
/usr/share/doc/docker-io-1.1.2/FIXME
/usr/share/doc/docker-io-1.1.2/LICENSE
/usr/share/doc/docker-io-1.1.2/LICENSE-vim-syntax
/usr/share/doc/docker-io-1.1.2/MAINTAINERS
/usr/share/doc/docker-io-1.1.2/NOTICE
/usr/share/doc/docker-io-1.1.2/README-vim-syntax.md
/usr/share/doc/docker-io-1.1.2/README.md
/usr/share/man/man1/docker-attach.1.gz
/usr/share/man/man1/docker-build.1.gz
/usr/share/man/man1/docker-commit.1.gz
/usr/share/man/man1/docker-cp.1.gz
/usr/share/man/man1/docker-diff.1.gz
/usr/share/man/man1/docker-events.1.gz
/usr/share/man/man1/docker-export.1.gz
/usr/share/man/man1/docker-history.1.gz
/usr/share/man/man1/docker-images.1.gz
/usr/share/man/man1/docker-import.1.gz
/usr/share/man/man1/docker-info.1.gz
/usr/share/man/man1/docker-inspect.1.gz
/usr/share/man/man1/docker-kill.1.gz
/usr/share/man/man1/docker-load.1.gz
/usr/share/man/man1/docker-login.1.gz
/usr/share/man/man1/docker-logs.1.gz
/usr/share/man/man1/docker-pause.1.gz
/usr/share/man/man1/docker-port.1.gz
/usr/share/man/man1/docker-ps.1.gz
/usr/share/man/man1/docker-pull.1.gz
/usr/share/man/man1/docker-push.1.gz
/usr/share/man/man1/docker-restart.1.gz
/usr/share/man/man1/docker-rm.1.gz
/usr/share/man/man1/docker-rmi.1.gz
/usr/share/man/man1/docker-run.1.gz
/usr/share/man/man1/docker-save.1.gz
/usr/share/man/man1/docker-search.1.gz
/usr/share/man/man1/docker-start.1.gz
/usr/share/man/man1/docker-stop.1.gz
/usr/share/man/man1/docker-tag.1.gz
/usr/share/man/man1/docker-top.1.gz
/usr/share/man/man1/docker-unpause.1.gz
/usr/share/man/man1/docker-version.1.gz
/usr/share/man/man1/docker-wait.1.gz
/usr/share/man/man1/docker.1.gz
/usr/share/man/man5/Dockerfile.5.gz
/usr/share/vim/vimfiles/doc
/usr/share/vim/vimfiles/doc/dockerfile.txt
/usr/share/vim/vimfiles/ftdetect
/usr/share/vim/vimfiles/ftdetect/dockerfile.vim
/usr/share/vim/vimfiles/syntax
/usr/share/vim/vimfiles/syntax/dockerfile.vim
/usr/share/zsh/site-functions/_docker
/var/lib/docker
/var/lib/docker 应该是存放本地image的目录. 在pull期间, 我只是du -sh了这个目录, 导致了pull失败, 如下 :
检索docker hub中包含postgresql的images.
[root@150 ~]# docker search postgresql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
postgres PostgreSQL is a powerful, open source obje... 208 [OK]
......
radbot/postgresql-9.3.5 0
......
运行这个image, 因为本地没有这个image, 所以会自动下载 :
[root@150 ~]# docker run radbot/postgresql-9.3.5 psql -V
Unable to find image 'radbot/postgresql-9.3.5' locally
Pulling repository radbot/postgresql-9.3.5
d61abc8c1dd3: Error pulling image (latest) from radbot/postgresql-9.3.5, Error mounting '/dev/mapper/docker-8:1-786593-68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280' on '/var/lib/docker/devicemapper/mnt/68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280': device or resource busy 6b950129ba1af9280': device or resource busy
9942dd43ff21: Download complete
d92c3c92fa73: Download complete
0ea0d582fd90: Download complete
cc58e55aa5a5: Download complete
c4ff7513909d: Download complete
68b76f93ae18: Download complete
82fe8ad2c400: Error downloading dependent layers
2014/09/29 09:58:02 Error pulling image (latest) from radbot/postgresql-9.3.5, Error mounting '/dev/mapper/docker-8:1-786593-68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280' on '/var/lib/docker/devicemapper/mnt/68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280': device or resource busy
创建container, unifs等.
不清楚是什么原因造成这个失败的, 我只是在这个过程中du了/var/lib/docker的目录.
失败后, 这个image还在本地.
[root@150 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c3d5614fecc4 24 hours ago 194.8 MB
<none> <none> 68b76f93ae18 5 weeks ago 232.9 MB
[root@150 ~]# docker images -a
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c3d5614fecc4 24 hours ago 194.8 MB
<none> <none> 96e1c132acb3 24 hours ago 194.8 MB
<none> <none> 311ec46308da 24 hours ago 192.8 MB
<none> <none> 1b2af7d5307a 24 hours ago 192.7 MB
<none> <none> c31865d83ea1 24 hours ago 192.7 MB
<none> <none> 8cbdf71a8e7f 24 hours ago 192.6 MB
<none> <none> 68b76f93ae18 5 weeks ago 232.9 MB
<none> <none> c4ff7513909d 6 weeks ago 213 MB
<none> <none> cc58e55aa5a5 6 weeks ago 213 MB
<none> <none> 0ea0d582fd90 6 weeks ago 192.7 MB
<none> <none> d92c3c92fa73 6 weeks ago 192.7 MB
<none> <none> 9942dd43ff21 6 weeks ago 192.7 MB
<none> <none> 1c9383292a8f 6 weeks ago 192.5 MB
<none> <none> 511136ea3c5a 15 months ago 0 B
删除image
[root@150 ~]# docker rmi -f 68b76f93ae18
Deleted: 68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280
Deleted: c4ff7513909dedf4ddf3a450aea68cd817c42e698ebccf54755973576525c416
Deleted: cc58e55aa5a53b572f3b9009eb07e50989553b95a1545a27dcec830939892dba
Deleted: 0ea0d582fd9027540c1f50c7f0149b237ed483d2b95ac8d107f9db5a912b4240
Deleted: d92c3c92fa73ba974eb409217bb86d8317b0727f42b73ef5a05153b729aaf96b
Deleted: 9942dd43ff211ba917d03637006a83934e847c003bef900e4808be8021dca7bd
Deleted: 1c9383292a8ff4c4196ff4ffa36e5ff24cb217606a8d1f471f4ad27c4690e290
[root@150 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c3d5614fecc4 24 hours ago 194.8 MB
再次运行依然失败, 说明问题不在image
[root@150 ~]# docker run radbot/postgresql-9.3.5 psql -V
Unable to find image 'radbot/postgresql-9.3.5' locally
Pulling repository radbot/postgresql-9.3.5
d61abc8c1dd3: Error pulling image (latest) from radbot/postgresql-9.3.5, Driver devicemapper failed to create image rootfs 68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280: device 68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280 already exists 5b0608253106b950129ba1af9280 already exists
9942dd43ff21: Download complete
d92c3c92fa73: Download complete
0ea0d582fd90: Download complete
cc58e55aa5a5: Download complete
c4ff7513909d: Download complete
68b76f93ae18: Error downloading dependent layers
2014/09/29 10:07:06 Error pulling image (latest) from radbot/postgresql-9.3.5, Driver devicemapper failed to create image rootfs 68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280: device 68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280 already exists
应该是创建container时造成的失败, 需要删除这个设备后才可以正常.
当前不能删除这个设备.
[root@150 ~]# dmsetup remove -f /dev/mapper/docker-8:1-786593-68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280
device-mapper: resume ioctl on docker-8:1-786593-68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280 failed: Invalid argument
device-mapper: remove ioctl on docker-8:1-786593-68b76f93ae18b25093f6d45a85f203c66af75b0608253106b950129ba1af9280 failed: Device or resource busy
Command failed
重启服务器, 再次pull, run成功.
[root@150 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c3d5614fecc4 24 hours ago 194.8 MB
<none> <none> c4ff7513909d 6 weeks ago 213 MB
[root@150 ~]# docker rmi c4ff7513909d
Deleted: c4ff7513909dedf4ddf3a450aea68cd817c42e698ebccf54755973576525c416
Deleted: cc58e55aa5a53b572f3b9009eb07e50989553b95a1545a27dcec830939892dba
Deleted: 0ea0d582fd9027540c1f50c7f0149b237ed483d2b95ac8d107f9db5a912b4240
Deleted: d92c3c92fa73ba974eb409217bb86d8317b0727f42b73ef5a05153b729aaf96b
Deleted: 9942dd43ff211ba917d03637006a83934e847c003bef900e4808be8021dca7bd
Deleted: 1c9383292a8ff4c4196ff4ffa36e5ff24cb217606a8d1f471f4ad27c4690e290
[root@150 ~]# docker run radbot/postgresql-9.3.5 psql -V
Unable to find image 'radbot/postgresql-9.3.5' locally
Pulling repository radbot/postgresql-9.3.5
d61abc8c1dd3: Download complete
511136ea3c5a: Download complete
1c9383292a8f: Download complete
9942dd43ff21: Download complete
d92c3c92fa73: Download complete
0ea0d582fd90: Download complete
cc58e55aa5a5: Download complete
c4ff7513909d: Download complete
68b76f93ae18: Download complete
82fe8ad2c400: Download complete
psql (PostgreSQL) 9.3.5
[root@150 yum.repos.d]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c3d5614fecc4 25 hours ago 194.8 MB
radbot/postgresql-9.3.5 latest d61abc8c1dd3 5 weeks ago 309 MB
[参考]
1. man docker