Search code examples
google-cloud-platformgoogle-container-os

Is it possible to pull the build number from a running Google Container-Optimized OS?


According to this page, one can pull the kernel sources from the following location in Google Cloud Storage.

gs://cos-tools/<build-number>/

I am trying to find the source for a running instance of the Container-Optimized OS, but I have not found documentation describing how to extract a build number from the running instance. The output of uname -r is 4.4.111+ but I do not know how to map this to a build number that I can use for pulling the source.

How does one find the build number?


Solution

  • Inside the running COS instance, you can find the version in /etc/lsb-release.

    $ cat /etc/lsb-release | grep CHROMEOS_RELEASE_VERSION
    CHROMEOS_RELEASE_VERSION=10452.101.0
    

    Then, in a machine with gsutil installed and configured

    $ gsutil ls gs://cos-tools/10452.101.0/
    gs://cos-tools/10452.101.0/kernel-src.tar.gz
    gs://cos-tools/10452.101.0/kernel-src.tar.gz.md5