So, I'm trying to build musl-libc inside an Alpine Linux Docker container. The configure script succeeds, but make stops immediately because it can't run mkdir:
mkdir -p lib
make: mkdir: Operation not permitted
make: *** [Makefile:96: lib] Error 127
Using strace, I can see that it's getting EPERM when it checks access on the various mkdir symlinks, so it never actually runs the command itself:
faccessat2(AT_FDCWD, "/usr/local/sbin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
faccessat2(AT_FDCWD, "/usr/local/bin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
faccessat2(AT_FDCWD, "/usr/sbin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
faccessat2(AT_FDCWD, "/usr/bin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
faccessat2(AT_FDCWD, "/sbin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
faccessat2(AT_FDCWD, "/bin/mkdir", X_OK, AT_EACCESS) = -1 EPERM (Operation not permitted)
I have no idea why this is. I'm running make as root, and /bin/busybox
has the executable bit set for all users anyway. I can create the directory just fine from the command line. What's going on here, and how do I fix it?
EDIT: As requested, here's the Dockerfile I'm using:
FROM alpine
ENV UTILS='vim tmux gdb strace git mandoc'
ENV DEPS='gcc make'
RUN apk update && apk add $DEPS $UTILS
ADD musl-src /musl-libc
ENV NPROC=6
RUN cd musl-libc && ./configure --prefix=/usr --enable-debug && \
make -j$NPROC
RUN cd musl-libc && make install
Requires the musl source in ./musl-src
.