I have several projects linked to Github repositories that build via a
Dockerfile in each project. This arrangement has been working fine, but all my builds started failing 100% of the time a while back. I’ve been trying to trace it and realized I didn’t really do anything and the issue it fails on is quite basic.
I’m using the archlinux base image and copying the source of my app to the container using something like:
COPY ./ /src
Next I move into that directory:
Then I try to build the software. Normally this would involve running
./configure, but that dies with a weird error saying “Operation not permitted”. It turn out this isn’t just an issue for GNU Make, even
ls can’t read the directory! Specifically the directory, not the stuff inside it. I can run
RUN ls -l and get a list of files in the source that got copied over, but I can’t run
RUN ls -ld to show the directory properties, it dies like this:
Step 17/28 : RUN ls -ald ---> Running in ec8f9f6c3604 ls: cannot access '.': Operation not permitted Removing intermediate container ec8f9f6c3604 The command '/bin/sh -c ls -ald' returned a non-zero code: 2
I can run various other commands, but anything that tries to look at the directory itself dies like this. I can even create files in the directory.
Note these same
Dockerfiles build just fine on my local system using
docker build. What gives? What is different about building them on Docker Hub?