Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Mounting volume in container-optimized vm permission issue

Hello,

I'm trying to run a Docker container in a container-optimized VM with a mounted volume. The volume is mounted in the VM with the owner as root. However, the Docker container isn't running as root, and I cannot change the image to run as root since the application won't start with the root user.

My container is running as privileged.
I tried to have a cloud-init script to chown the mounted disk, but cloud-init seems to run before the disk is mounted, so that doesn't work. 

Is there a way to change the permissions of a mounted disk before it is mounted as a volume in Docker?

2 0 108