Why do I get "error while applying layer: operation not permitted" with buildah in a gitlab runner pod?

1.1k views Asked by At

Hey I have a Gitlab runner(kubernetes executor) that is building containers inside a pipeline.

The pipeline runs inside a pod with the image: quay.io/buildah/stable and fails while calling buildah bud .:

STEP 1/12: FROM docker.io/parity/parity:v2.5.13-stable
Trying to pull docker.io/parity/parity:v2.5.13-stable...
Getting image source signatures
Copying blob sha256:4aae9d2bd9a7a79a688ccf753f0fa9bed5ae66ab16041380e595a077e1772b25
Copying blob sha256:72d77d7d5e84353d77d8a8f97d250120afe3650b85010137961560bce3a327d5
Copying blob sha256:49ac0bbe6c8eeb959337b336ceaa5c3bbbae81e316025f9b94ede453540f2377
Copying blob sha256:d1983a67e104e801fceb1850a375a71fe6b62636ba7a8403d9644f308a6a43f9
Copying blob sha256:1a0f3a523f04f61db942018321ae122f90d8e3303e243b005e8de9817daf7028
Copying blob sha256:3386e6af03b043219225367632569465e5ecd47391d1f99a6d265e51bd463a83
Copying blob sha256:3386e6af03b043219225367632569465e5ecd47391d1f99a6d265e51bd463a83
...
Copying blob sha256:92c90097dde63c8b1a68710dc31fb8b9256388ee291d487299221dae16070c4a
time="2022-03-03T16:01:36Z" level=error msg="Error while applying layer: ApplyLayer exit status 1 stdout:  stderr: operation not permitted"
error creating build container: writing blob: adding layer with blob "sha256:3386e6af03b043219225367632569465e5ecd47391d1f99a6d265e51bd463a83": ApplyLayer exit status 1 stdout:  stderr: operation not permitted

I tried recreating this in a new pod: kubectl run -it buildah --image containers/buildah --command tail -f /dev/null with a simpler Dockerfile:

FROM ubuntu
RUN touch /test
CMD ["echo", "hello"]

and it worked. Building with the actual project outside the pod also works. I couldn't figure out how to mount the project into the pod, so I haven't built the whole project in there yet.

So why doesn't it run in the gitlab runner? Can this maybe be a misconfiguration in the gitlab runner?

0

There are 0 answers