HOW TO: Run Docker Container On Google Cloud Run 2023 (FREE*)

preview_player
Показать описание
*FREE tier (see explanation below)
- CPU: First 180,000 vCPU-seconds free per month
- Memory: First 360,000 GiB-seconds free per month
- Requests: 2 million requests free per month
--------------------------------------------------------------------------------------
Steps:
• Create a repo on Docker hub
• Tag your existing image using the docker hub username and repo name:
`docker tag existing-image hub-user/repo-name[:tag]`
• Now you can push this repository to the registry designated by its name or tag.
`docker push hub-user/repo-name:tag`
• Public URL to the docker image is:
• Go to cloud run and click `Create Service`
• Enter the Container image URL:
• Enter port: 8501 (same as the one specified in Dockerfile)
• Select the region that will be closest to the intended customers’ location.
• Keep everything else as default.
• Click Deploy
• You will get an HTTPS URL.
--------------------------------------------------------------------------------------
Explanation about units in cloud run:
- Units: vCPU-seconds/month; GB-seconds/month; requests/month; GB egress/month
- For example, if you specified each machine to have 2 CPU cores with 1GB of RAM. And it serves for 150,000 seconds (counted only when it's processing something, which means you will not be billed when no one is making requests). That will be counted as 2x150,000 vCPU-seconds and 150,000 GB-seconds.
- Requests are the number of times the container was reached successfully.
- GB egress is the amount of outgoing data.
Рекомендации по теме
Комментарии
Автор

Thank you! Super simple, and I managed to have my 2 separate containers be deployed this way and make them communicate to each other.

I was down a rabbit-hole of working with VM's, but this was incredibly simple and well-explained!

mickdonalds
Автор

I followed this video and success. Thank you very much.

khoaho
Автор

Great video! Could you explain how to configure the container to run? I am familiar with using 'docker --device' locally, but I am unsure how to achieve the same result on Google Cloud.

romanwolf
Автор

Great video! Would love the tutorial on docker-compose! 😄

adriel.guitar.explorer
Автор

Thanks a lot clear & straight to point ( Just wanted to know do they charge any fee for hosting ? I followed the steps you've mentioned just want to be careful :p )

poorpanda
Автор

The dockerfile doesn't contain the expose port. What should i put in the port? 8080 and 8000 aren't working.

Crackhead
Автор

And what about private docker hub registry? Is it possible to configure auth in gcp somehow?

olegderivedmed
Автор

Hello bro.

Can you send a link to the document which you are using as guideline

japan