nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.82k stars 307 forks source link

make: /bin/sh: Operation not permitted when running the Dockerfile #215

Closed dan-dr closed 2 years ago

dan-dr commented 2 years ago

Just running the Dockerfile in the root of the project I'm getting an error. Might be related to https://gitlab-test.alpinelinux.org/alpine/aports/-/issues/12321 ?

Opening while I'm trying to solve.

------------------------- Tue Feb 08 2022 10:04:05 GMT+0000 (Coordinated Universal Time)
Build started for testapp
Step 1/15 : FROM alpine:3.14.3 AS stage

---> 0a97eee8041e
Step 2/15 : LABEL maintainer="Nicolas Favre-Felix <n.favrefelix@gmail.com>"

---> Using cache
---> 51b2d543ab27
Step 3/15 : RUN apk update && apk add wget make gcc libevent-dev msgpack-c-dev musl-dev openssl-dev bsd-compat-headers jq

---> Using cache
---> e2514f1b9744
Step 4/15 : RUN wget -q https://api.github.com/repos/nicolasff/webdis/tags -O /dev/stdout | jq '.[] | .name' | head -1  | sed 's/"//g' > latest

---> Using cache
---> 1bc91303e54c
Step 5/15 : RUN wget https://github.com/nicolasff/webdis/archive/$(cat latest).tar.gz -O webdis-latest.tar.gz

---> Using cache
---> 09ea8974c71a
Step 6/15 : RUN tar -xvzf webdis-latest.tar.gz

---> Using cache
---> 06ac631b66cb
Step 7/15 : RUN cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd ..

---> Running in d0be5a7c4234
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
make: dirname: Operation not permitted

make: cc: Operation not permitted
make: *** [Makefile:95: src/webdis.o] Error 127

cc -c -Wall -Wextra -Isrc -Isrc/jansson/src -Isrc/http-parser -MD  -O3 -o src/webdis.o src/webdis.c
{"code":2,"message":"The command '/bin/sh -c cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd ..' returned a non-zero code: 2"}
The command '/bin/sh -c cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd ..' returned a non-zero code: 2
Build has failed!
----------------------
Deploy failed!
Error: {"code":2,"message":"The command '/bin/sh -c cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd ..' returned a non-zero code: 2"}
The command '/bin/sh -c cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd ..' returned a non-zero code: 2
dan-dr commented 2 years ago

Solved. had to update docker-ce

nicolasff commented 2 years ago

Interesting issue, I had never seen this before. The command that failed seems really innocuous, it's just a simple shell expression so I'm surprised that it would fail at any version of Docker Engine. Especially given that the commands above (wget, tar, and more) all went through just fine.

If you still have this information, do you know which version you had this issue with? It could be a useful reference in case anyone else encounters this problem.