### Creating VM Instance from Image (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to create a new virtual machine instance in GCP Compute Engine using the previously imported custom image `alpine-gcp`. Replace `instance-name` and `zone` with desired values. ```Shell gcloud compute instances create instance-name --zone zone --image alpine-gcp ``` -------------------------------- ### Building Image with Packer (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to execute the Packer build process using the `alpine-gcp.json` template, which creates the raw disk image. ```Shell packer build alpine-gcp.json ``` -------------------------------- ### Creating Cloud Storage Bucket (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to create a new Cloud Storage bucket named `alpine-gcp` using the `gsutil` tool, which is required to host the image file before importing it into GCP Compute Engine. ```Shell gsutil mb gs://alpine-gcp ``` -------------------------------- ### Uploading Image to Cloud Storage (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to copy the compressed image file from the local temporary directory (`/tmp`) to the specified Cloud Storage bucket (`gs://alpine-gcp`). ```Shell gsutil cp /tmp/alpine_gcp.tar.gz gs://alpine-gcp ``` -------------------------------- ### Importing Image into GCP Compute Engine (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to create a new custom image in GCP Compute Engine named `alpine-gcp`, using the compressed image file uploaded to the Cloud Storage bucket as the source. ```Shell gcloud compute images create alpine-gcp --source-uri gs://alpine-gcp/alpine_gcp.tar.gz ``` -------------------------------- ### Compressing Disk Image with Tar (Shell) Source: https://github.com/katadelos/alpine-gcp-image-builder/blob/master/README.md Command to compress the generated `disk.raw` image into a gzipped tar archive (`alpine_gcp.tar.gz`) suitable for uploading to Cloud Storage. ```Shell tar --format=oldgnu -Sczf /tmp/alpine_gcp.tar.gz -C build disk.raw ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.