2
votes

I am getting the following "permission denied" error when trying to deploy an image to Cloud Run:

Application failed to start: Failed to create init process: Failed to load /usr/local/bin/dumb-init: permission denied

The Dockerfile contains these instructions:

....
....
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
....
....
ENTRYPOINT ["dumb-init", "--"]

The image runs successfully locally but cannot be deployed to Cloud run due to the above error.

1
I don't have an answer. I am not sure what you are trying to accomplish in Cloud Run with dumb-init. However, you need to be launching a process that responds to HTTP requests on $PORT otherwise Cloud Run will kill your container. You are not including enough of your project to reproduce anything.John Hanley
As far as I can tell, @JohnHanley is right, you should be starting a process listening on PORT env var. But this doesn't really explain the permission denied error. Also note that Cloud Run doesn't allow passing extra arguments to your process, so you're actually executing ["dumb-init", "--"]. I'm surprised it runs fine locally.Ahmet Alp Balkan
I ran into the same problem, you can apply this change to fix it.sonerokur

1 Answers

0
votes

Downloading the binary directly Since dumb-init is released as a statically-linked binary, you can usually just plop it into your images. Here's an example of doing that in a Dockerfile:

RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64

RUN chmod +x /usr/local/bin/dumb-init

More info on downloading the binary directly.