Container-Optimized OS from Google is built on top of the Chromium OS open-source project. You can find the majority of the source code for Container-Optimized OS in the COS repositories https://cos.googlesource.com.
Some of the useful resources that can help you determine the source code used to build the image include:
Inside the OS image, the
/opt/google/chrome/resources/about_os_credits.htmlfile contains version and license information for all the packages used to build that image.
Kernel source: https://cos.googlesource.com/third_party/kernel/+/cos-5.4.
Kernel config: https://cos.googlesource.com/cos/overlays/board-overlays/+/refs/heads/master/project-lakitu/sys-kernel/lakitu-kernel-5_4/files/base.config-x86_64.
The commit SHA1 of the kernel source used to build a particular version is also provided in the release-notes for that version.
Additional image artificats, including archived kernel sources and kernel headers, are also available in a public Google Cloud Storage bucket under
gs://cos-tools/<build-number>/. For example, artifacts for
$ gsutil ls gs://cos-tools/11021.11.0/ gs://cos-tools/11021.11.0/kernel-headers.tgz gs://cos-tools/11021.11.0/kernel-src.tar.gz gs://cos-tools/11021.11.0/kernel-src.tar.gz.md5
Those familiar with Chromium OS build system may also find the build recipes under https://cos.googlesource.com/cos/overlays/board-overlays/+/master/project-lakitu/ useful.
Actual source code archives for individual packages can also be found under one of the package mirrors maintained by Chromium OS build system. You can access them by appending the correct tarball name to one of the following URLs:
For example, to download kubernetes version 1.19.2, use https://storage.googleapis.com///chromeos-localmirror/distfiles/kubernetes-server-linux-amd64-1.19.2.tar.gz.
Building from source
Follow the instructions on Building from Open Source to build a Container-Optimized OS disk image from the source.
Contributing to source code
See http://dev.chromium.org/developers/contributing-code for instructions on contributing code to the main Chromium repository.