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.
Most of your images will be created on top of a base image from the Docker Hub registry. Docker Hub contains many pre-built images that you can pull and try without needing to define and configure your own. To download a particular image, or set of images (i.e., a repository), use docker pull .
Head over to the Google Cloud Platform Console, and select “Create Service.” Select the region that you want it to run in, and give it a name. You can also choose to secure this container with Cloud IAM.
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 Dockerfile
So then, use the Cloud Run URL instead of the http://localhost:3000
that you have in the documentation and enjoy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With