I'm creating my GCE instance with gcloud beta compute instances create-with-container and the following startup-script:
#! /bin/bash
gsutil cp gs://artifacts.<PROJECT-ID>.appspot.com/some-file .
docker-credential-gcr configure-docker
docker pull gcr.io/<PROJECT-ID>/image:tag
docker run --name compose --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock docker/compose:1.26.0 up -d --force-recreate
but I am ending with the following:
Jun 23 15:22:08 app startup-script[389]: INFO Found startup-script in metadata.
Jun 23 15:22:08 app startup-script[389]: INFO startup-script: /var/lib/google/startup-DqGmUt/tmpPyYsVd: line 2: gsutil: command not found
Jun 23 15:22:09 app startup-script[389]: INFO startup-script: ERROR: Unable to save docker config: mkdir /root/.docker: read-only file system
I tried installing gsutil also in the startup-script but it bails out with the same problem of /root being RO. Is it actually possible to do this on a COS image?