6

As it is the Linux version of OS, I tried firing, hoping that would work

apt-get install jq

But it says apt-get: command not found.

How I can install new binaries as I wanted to add some extra logic in the startup script which required few extra libs to be installed first.

Please correct me if I am doing anything wrong.

Indrajeet Gour
  • 4,020
  • 5
  • 43
  • 70

3 Answers3

6

Container OS is locked down. You are prohibited from installing programs. Create a container and run the command in the container.

Container-Optimized OS does not include a package manager; as such, you'll be unable to install software packages directly on an instance. However, you can use CoreOS toolbox to install and run debugging and admin tools in an isolated container.

Container-Optimized OS Overview

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • Yes I can understand this, but I wanted to know how I can have a modification to startup script for containerized OS VM where I need to validate few logic and sent some messages to pubsub if those conditions met... – Indrajeet Gour Dec 03 '20 at 05:07
  • 3
    Your original question has been answered. Create a new question. There are many options for sending messages via Pub/Sub. That is an entire topic to itself. However, you cannot change the Container OS startup script. If you want that level of control you will need to launch your own Compute Engine instance, install Docker, etc. – John Hanley Dec 03 '20 at 05:14
  • You are saying that instead of using "create-with-container" for compute instance, we need to deploy normal VM and install docker for our deployment, so we can install what ever we want – Indrajeet Gour Dec 03 '20 at 05:41
  • 1
    Yes, that is what I am saying. – John Hanley Dec 03 '20 at 05:42
4

https://cloud.google.com/container-optimized-os/docs/how-to/toolbox You can use toolbox to install the package

0

You can specify a startup script through the metadata server. The script would be run at boot time.

laylaylom
  • 1,754
  • 16
  • 15