Last active
September 22, 2022 16:59
-
-
Save nwaughachukwuma/325cfa132941d4b48990f56b2b146a7d to your computer and use it in GitHub Desktop.
Revisions
-
nwaughachukwuma revised this gist
Sep 22, 2022 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ 1. Build the image from a `Dockerfile` 1. `docker build ./ --tag {name}:latest`. Advisable to use your service name here 2. Test if the application is running -
nwaughachukwuma revised this gist
Sep 22, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ### How to deploy a docker image to cloud run [for pros] 1. Build the image from a `Dockerfile` 1. `docker build ./ --tag {name}:latest`. Advisable to use your service name here -
nwaughachukwuma created this gist
Sep 22, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ Deploy a docker image to cloud run [for pros] 1. Build the image from a `Dockerfile` 1. `docker build ./ --tag {name}:latest`. Advisable to use your service name here 2. Test if the application is running 1. `docker run -p 8080:8080 -it name` 2. `docker run -p 8080:8080 -e ENV=VALUE -it name` 1. e.g. `docker run -p 8080:8080 -e PORT=8080 -it name` 3. Configure docker on GCloud CLI 1. `gcloud auth configure-docker gcr.io` 2. `gcloud auth configure-docker {region}.gcr.io` 4. Enable cloud-run if it isn’t enabled, using cloud console or GCloud CLI 5. Map the tag to your service on Cloud Run 1. `docker tag name gcr.io/{PROJECT_ID}/{service_name}` 6. Push the image to GCloud container registry 1. `docker push gcr.io/{PROJECT_ID}/{service_name} 7. Provision the image on cloud run 1. Go to your service on cloud run 2. Choose `EDIT and DEPLOY` 3. Select your image from container registry 4. Select custom options as it suits your project 5. Deploy