make: printf: Operation not permitted when building a docker image with alpine 3.17
This issue: #12396 (closed) appears to have resurfaced with alpine 3.17 on x86_64.
I am building a docker image on CircleCI with alpine 3.17 and I'm seeing this:
e85fc22e: Pulling fs layer
e25411da: Pulling fs layer
dc0be345: Pulling fs layer
Digest: sha256:f1657204d3463bce763cefa5b25e48c28af6fe0cdb0f68b354f0f8225ef61be7
Status: Downloaded newer image for node:16-alpine
---> 8cf71856f96e
Step 2/33 : RUN apk update && apk add git python3 make g++ gcc curl && rm -rf /var/cache/apk/*
---> Running in e1089a4937ac
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
v3.17.3-220-geb1a1f718c8 [https://dl-cdn.alpinelinux.org/alpine/v3.17/main]
v3.17.3-218-g494dbdad1c2 [https://dl-cdn.alpinelinux.org/alpine/v3.17/community]
OK: 17823 distinct packages available
[some elided]
warning Error running install script for optional dependency: "/app/k/node_modules/unix-dgram: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /app/k/node_modules/unix-dgram
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@16.20.0 | linux | x64
gyp info find Python using Python version 3.10.11 found at \"/usr/bin/python3\"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/app/k/node_modules/unix-dgram/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/16.20.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.20.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.20.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/app/k/node_modules/unix-dgram',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/app/k/node_modules/unix-dgram/build'
make: Leaving directory '/app/kfrak/node_modules/unix-dgram/build'
make: printf: Operation not permitted
make: *** [unix_dgram.target.mk:113: Release/obj.target/unix_dgram/src/unix_dgram.o] Error 127
I'm not able to replicate this locally, this only happens in CircleCI when building for x86_64. It does not happen when building for ARM.
My Dockerfile is using node:16-alpine
as the base image.