A simple Dockerfile that executes a shell script as entrypoint like this
FROM python:3
WORKDIR /app
COPY . .
RUN chmod +x entrypoint.sh
CMD ["python", "/app/src/api.py"]
ENTRYPOINT ["./entrypoint.sh"]
works: entrypoint.sh
is called, which itself executes python /app/src/api.py
on a RPI 3.
entrypoint.sh
#!/bin/bash
echo starting entrypoint
set -x
exec "$@"
Since I don't need anything Debian/Raspbian specific, I'd like to use the alpine image to reduce image size. So I changed FROM python:3
to FROM python:3-alpine
without any further changes.
But now the container doesn't start:
api_1 | standard_init_linux.go:211: exec user process caused "no such file or directory"
test_api_1 exited with code 1
Why doesn't this work on Alpine? I don't see any problem since /app/entrypoint.sh
exists and it's also executable:
Step 5/7 : RUN ls -lh
---> Running in d517a83c5b9b
total 12K
-rwxr-xr-x 1 root root 54 Jul 11 18:35 entrypoint.sh
drwxr-xr-x 2 root root 4.0K Jul 11 18:48 src
In a similar question, the image was buld on a non-arm system. This is not the case for me, I'm building directly on the RPI.
Not sure if this is Raspbian or Alpine related. I also tried using the absolute path ENTRYPOINT ["/app/entrypoint.sh"]
: Still working on python:3
image, but broken in python:3-alpine
.