-
-
Save cage1016/eaceed444a94c4b9053d6b8dc6765a54 to your computer and use it in GitHub Desktop.
f1-micro run code-server
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
gcloud compute firewall-rules create rule-allow-tcp-8080 --source-ranges 0.0.0.0/0 --target-tags allow-tcp-8080 --allow tcp:8080 | |
gcloud compute instances create-with-container vscode \ | |
--zone us-east1-b \ | |
--container-stdin \ | |
--container-tty \ | |
--container-mount-host-path=mount-path=/home/coder/project,host-path=/mnt/disks/data,mode=rw \ | |
--container-image=codercom/code-server:latest \ | |
--machine-type=f1-micro \ | |
--metadata=^:^startup-script='#! /bin/bash | |
if [ -d /mnt/disks/data ]; then | |
exit 0 | |
fi | |
sudo mkdir /mnt/disks/data | |
sudo mount -o discard,defaults /dev/sdb /mnt/disks/data | |
sudo chmod a+w /mnt/disks/data | |
' \ | |
--container-arg="--auth" \ | |
--container-arg="none" | |
gcloud compute instances add-tags vscode --zone=us-east1-b --tags http-server,https-server,allow-tcp-8080 | |
gcloud compute instances describe vscode --zone=us-east1-b | |
gcloud compute instances delete vscode --zone us-east1-b | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment