Docker Community Forums

Share and learn in the Docker community.

Npm prune --production fails in DinD build


#1

I’m running into an issue running DinD in Gitlab CI. During a docker build one of our steps is a npm prune —production. That step ends up failing with the following error:

npm ERR! Linux 3.10.0-327.28.3.el7.x86_64
npm ERR! argv “/opt/nodejs/node-v4.4.7-linux-x64/bin/node” “/usr/bin/npm” “prune” "–production"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! path /tmp/app/node_modules/abbrev
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir

npm ERR! ENOTEMPTY: directory not empty, rmdir '/tmp/app/node_modules/abbrev’
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /tmp/app/npm-debug.log
The command ‘/bin/sh -c npm prune --production’ returned a non-zero code: 217
ERROR: Build failed: exit code 217

Now I am able to get around this issue if I set the DinD image to use the VFS storage driver, but with that the build is so slow it’s not an option (3 min build becomes a 50 min build). I’ve tried running runner VM and the DinD image is every combination of storage drives I could, even mounting different data volumes all to no avail. I must be just missing something, but could really use some help.

Here are the details on the environment.

Base VM is Centos 7.1 kernel 3.10.0-327.28.3.el7.x86_64

docker.conf
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
ExecStart=
ExecStart=/usr/bin/docker daemon --log-driver=journald -s devicemapper -g /opt/gitlabRunnerData \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$ADD_REGISTRY \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
MountFlags=slave

[Install]
WantedBy=multi-user.target

config.toml
concurrent = 3
check_interval = 0

[[runners]]
name = "DinD Build"
url = "https://xxx.com/ci"
token = “xxxxxxxxxxxx"
executor = “docker”
[runners.docker]
tls_verify = false
image = docker:latest
privileged = true
disable_cache = true
[runners.cache]

Docker info on the base VM

Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 5
Server Version: 1.12.3
Storage Driver: devicemapper
Pool Name: docker-202:96-145595393-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 476.2 MB
Data Space Total: 107.4 GB
Data Space Available: 53.15 GB
Metadata Space Used: 1.532 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.146 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: /opt/gitlabRunnerData/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: /opt/gitlabRunnerData/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2016-06-09)
Logging Driver: journald
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: overlay null host bridge
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 3.10.0-327.28.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.451 GiB
Name: ip-10-240-6-46
ID: S7FY:YHOU:KTGE:5M46:CMCC:QWS5:UFQP:DZUS:ZDBB:2AKF:56DC:EQHK
Docker Root Dir: /opt/gitlabRunnerData
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
127.0.0.0/8