- Build the image from a
Dockerfile
docker build ./ --tag {name}:latest
. Advisable to use your service name here
- Test if the application is running
docker run -p 8080:8080 -it name
docker run -p 8080:8080 -e ENV=VALUE -it name
- e.g.
docker run -p 8080:8080 -e PORT=8080 -it name
- e.g.
- Configure docker on GCloud CLI
gcloud auth configure-docker gcr.io
gcloud auth configure-docker {region}.gcr.io
- Enable cloud-run if it isn’t enabled, using cloud console or GCloud CLI
- Map the tag to your service on Cloud Run
docker tag name gcr.io/{PROJECT_ID}/{service_name}
- Push the image to GCloud container registry
- `docker push gcr.io/{PROJECT_ID}/{service_name}
- Provision the image on cloud run
- Go to your service on cloud run
- Choose
EDIT and DEPLOY
- Select your image from container registry
- Select custom options as it suits your project
- Deploy
Last active
September 22, 2022 16:59
-
-
Save nwaughachukwuma/325cfa132941d4b48990f56b2b146a7d to your computer and use it in GitHub Desktop.
Seven easy steps to deploy a docker image to cloud run [for pros]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment