Azure上的Docker centos vm:处理tar文件时出错,设备上没有剩余空间

时间:2019-06-29 19:32:10

标签: linux azure docker

在构建容器时,我收到:

Error processing tar file(exit status 1): write xxx: no space left on device.

在运行此构建之前,我基于this发出了命令docker system prune

版本:

Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        2d0083d
 Built:             Thu Jun 27 17:56:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       2d0083d
  Built:            Thu Jun 27 17:26:28 2019
  OS/Arch:          linux/amd64
  Experimental:     false

信息:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 10
Server Version: 18.09.7
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-957.21.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.793GiB
Name: Py4SAS-vm
ID: AMQ6:47OK:DGUB:WTLF:NK7N:AVSN:TZOR:EJDS:OELL:TGAY:BRP7:NCVC
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

主机文件系统很大:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        30G  2.9G   27G  10% /
devtmpfs        3.4G     0  3.4G   0% /dev
tmpfs           3.4G     0  3.4G   0% /dev/shm
tmpfs           3.4G  9.1M  3.4G   1% /run
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
/dev/sda1       497M   90M  408M  18% /boot
/dev/sdd1       504G  5.9G  473G   2% /docker
/dev/sdc1       504G   37G  442G   8% /opt
/dev/sdb1        14G   41M   13G   1% /mnt/resource
tmpfs           696M     0  696M   0% /run/user/1000

对于失败的构建,/var/lib/docker

(base) [root@Py4SAS-vm docker]# du -shc *
16K     builder
56K     buildkit
0       containers
928K    image
44K     network
261M    overlay2
0       plugins
0       runtimes
0       swarm
0       tmp
0       trust
24K     volumes
262M    total

我什至重新安装了Docker并修改了启动脚本/usr/lib/systemd/system/docker.service,并将--storage-opt参数添加为:

ExecStart=/usr/bin/dockerd --storage-opt dm.basesize=50G -H fd:// --containerd=/

,然后重新启动Docker。我是Azure的新手,能够以12.5GiB的价格将此Dockerfile构建在AWS上。

如何使该图像正确构建?

0 个答案:

没有答案