下载大文件的构建docker镜像失败,错误为

时间:2016-10-12 22:17:21

标签: docker

我是码头工人的新手。我已经尝试了不到两周的时间。我们有一项服务,我们希望迁移到容器中。该服务使用了大约50G的数据,因此我们希望图像非常大。我们为它编写了一个Dockerfile。当我们运行构建时,它会失败,并带有ff:

ApplyLayer exit status 1 stdout: stderr: write /mnt/spine_features/spine_features_subset.lmdb/data.mdb: input/output error

当我们检查docker ps -a的容器时,我们可以看到列出的构建容器状态为:

Exited (1) About a minute ago

当我们尝试提交容器时,我们得到了同样的错误:

Error response from daemon: ApplyLayer exit status 1 stdout: stderr: write /mnt/spine_features/spine_features_subset.lmdb/data.mdb: input/output error

我们也可以停靠检查容器。当我们排除下载最大的文件时,我们能够完成构建服务图像。是否有某种配置我们可以改变成功,同时还包括更大的文件?

docker version

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.7
 Git commit:   23cf638
 Built:        Fri Aug 19 02:03:02 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.7
 Git commit:   23cf638
 Built:        Fri Aug 19 02:03:02 2016
 OS/Arch:      linux/amd64

码头信息

Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 22
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-8:2-7603782-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 214.7 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 67.78 GB
 Data Space Total: 107.4 GB
 Data Space Available: 39.59 GB
 Metadata Space Used: 37.04 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.11 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.134 (2016-09-07)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.7.4-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 15.58 GiB
Name: mega-haro
ID: MDQ5:JIT3:BVQX:XYO6:YTXI:HTRE:N2UQ:ML4V:ENIE:DDCO:ZGYF:3P5F
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 misty:5000
 127.0.0.0/8

1 个答案:

答案 0 :(得分:0)

正如Haoming Zhang所建议的那样,将主机目录安装到容器中是一种可接受的解决方案。我们还在探索使用FUSE在运行时将数据加载到容器中的可能性,而不是在构建期间将其烘焙到映像中,或者让主机在运行容器时将其传递到容器中。