Created
January 4, 2022 03:30
-
-
Save seandavi/fd061b6318bb6d2456dcc6f464390993 to your computer and use it in GitHub Desktop.
Start and stop an Rstudio-based container on GCP VM
This file contains 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 characters
#!/bin/bash | |
CONTAINER=ghcr.io/seandavi/buildabiocworkshop | |
ZONE=us-central1-a | |
PASSWORD=rstudio | |
INSTANCE=rs-2 | |
gcloud compute instances create-with-container $INSTANCE \ | |
--container-image $CONTAINER \ | |
--container-env PASSWORD=$PASSWORD \ | |
--tags rstudio | |
gcloud compute firewall-rules create allow-rstudio \ | |
--allow tcp:8787 --target-tags rstudio | |
This file contains 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 characters
#!/bin/bash | |
CONTAINER=ghcr.io/seandavi/buildabiocworkshop | |
ZONE=us-central1-a | |
PASSWORD=rstudio | |
INSTANCE=rs-2 | |
gcloud compute instances delete $INSTANCE --zone=$ZONE | |
gcloud compute firewall-rules delete allow-rstudio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment