Docker Community Forums

Share and learn in the Docker community.

Npm prune --production fails in DinD build


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! 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!

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

Description=Docker Application Container Engine

ExecStart=/usr/bin/docker daemon --log-driver=journald -s devicemapper -g /opt/gitlabRunnerData \


concurrent = 3
check_interval = 0

name = "DinD Build"
url = ""
token = “xxxxxxxxxxxx"
executor = “docker”
tls_verify = false
image = docker:latest
privileged = true
disable_cache = true

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
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
Docker Root Dir: /opt/gitlabRunnerData
Debug Mode (client): false
Debug Mode (server): false
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries: