I'm trying to pull Docker images into Google Cloud Run. I see that I would probably need to pull it first to Google Container registry, but can I somehow avoid it? Also, I'd rather have it straight from the source to have it up-to-date.
I got a look on the project and finally I successfully run it on Cloud Run
Firstly, you can't pull image outside Google Container Registry or Artifact Registry. So you need to pull the image, tag it and push it in GCP (your project or not, but on GCP)
Here the steps
# Pull the image (I did it on Cloud Shell)
docker pull thecodingmachine/gotenberg:6
# Tag the image
docker tag thecodingmachine/gotenberg:6 gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6
#Push the image (no authentication issue on Cloud Shell)
docker push gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6
# Deploy on Cloud Run
gcloud run deploy --image=gcr.io/<MY_PROJECT_ID>/thecodingmachine/gotenberg:6 \
--port=3000 --region=us-central1 --allow-unauthenticated --platform=managed \
--command=gotenberg gotenberg
The trick on the Cloud Run deployment is:
/tini
) and the container should be not well built because there is permission issue. More detail in the DockerfileSo then, use the Cloud Run URL instead of the http://localhost:3000
that you have in the documentation and enjoy!