I have a github actions workflow which builds and pushes the docker images to container registry on GCP. Post that it deploys the images onto compute engine. Currently three images are being deployed on three separate VMs. The goal is to have these on the same VM machine.
Tried to Manually create the VMs on the GCP but it lets me add only one image so far. Please help me with the settings or how I can create a VM that can host several Images on it. If not, please suggest a best way to overcome this situation.
It is possible via
cloud-init
, below is an example.Add the below custom metadata to the GCE instance running COS, this will start two containers in the same instance.
Then restart the instance to have the changes take effect, and run below commands to test after that.