Search code examples
pythonubuntugoogle-cloud-platformcloudgoogle-cloud-datalab

GCP - Create Datalab instance with OS image


I want to create a Datalab VM instance with ubuntu on it, but the tutorials only explain how to customise the machine type, not the Operating system. How do I create a Datalab VM with Ubuntu?


Solution

  • You can specify the image used with the --image-name flag (docs). The Ubuntu image can be retrieved from Docker Hub, for example. You can see an example here where they tag an image and push it to GCR (Google Container Registry):

    docker tag datalab gcr.io/PROJECT_ID/datalab
    

    And then you can specify that image upon Datalab instance creation with the aforementioned flag:

    datalab create --image-name=gcr.io/PROJECT_ID/datalab INSTANCE_NAME