I'm running a container-optimized compute instance with this startup-script:
#!/bin/bash
mkdir /home/my-app
cd /home/my-app
export HOME=/home/my-app
docker-credential-gcr configure-docker
docker run --rm --security-opt seccomp=./config.json gcr.io/my-project/my-app:latest
This scripts works well when creating a new instance. But when I restart an existing instance it doesnt't pull the latest image.
I've tried to delete all images from the gcr, the instance was able to start anyways, which proves that it doesn't even try to pull the latest image from gcr.
Also, for some reason startup-script logs are not showing up in Cloud Logger.
touch ~/testfile1- or anythnig that would indicate that willmake a markand tell you the script actually ran. Maybe you can pull some logs (from the VM itself) ? If so please update your question with as much details of what you've tried and what were the results. - Wojtek_Bjournalctlto view the boot logs. You will find the startup script logging in the boot logs. - John Hanley