Docker build 時發生"rm -rf cannot remove /some/path/ .. directory not empty"
於AWS上設定gitlab-runner CI運行時彈出了錯誤
rm -rf cannot remove [/some/path/] .. directory not empty
跑一下docker info 發現是檔案系統出現衝突 (大概是沒有設定好 )
$ docker info
Containers: 4
Running: 1
Paused: 0
Stopped: 3
Images: 13
Server Version: 17.05.0-ce
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-327.10.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.451GiB
Name: ip-10-1-0-74.ap-southeast-1.compute.internal
ID: LGG5:OC6X:6Z26:X6PH:L3FE:K6B4:NM6O:2ZIK:IGHP:UOJW:TDY2:UHY5
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
Reformat the filesystem with ftype=1 to enable d_type support.
Running without d_type support will not be supported in future releases.
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
把storage driver改成 devicemapper就沒有問題了
WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
不過production還是選個支持比較好的kernel就是了… ( build machine 就算了 XD) ref: https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#configure-loop-lvm-mode-for-testing