Yelp / dumb-init

A minimal init system for Linux containers
https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html
MIT License
6.83k stars 344 forks source link

can't find file when use alpine #293

Closed lyj0309 closed 1 year ago

lyj0309 commented 1 year ago

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 1 year ago

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 1 year ago

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