can't find file when use alpine
lyj0309 opened this issue · 2 comments
lyj0309 commented
when i try to use alpine to build my image, there is a error, output is [dumb-init] /run.sh: No such file or directory
but when i use docker cp xxx:/run.sh . , it's work, so the file is here but dumb-init can't find it.
FROM nginx:alpine
RUN apk add dumb-init --no-cache
WORKDIR /root
COPY run.sh /run.sh
RUN chmod +x /run.sh
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/run.sh"]
asottile commented
works fine for me -- is the shebang wrong on your executable? also generally you shouldn't chmod as a layer and instead have it be executable outside your image
lyj0309 commented
works fine for me -- is the shebang wrong on your executable? also generally you shouldn't chmod as a layer and instead have it be executable outside your image
I find the problem, I use bash on run.sh to run my program, but alpine not have bash, only sh. Thanks a lot about your suggest