I would like to build a Docker container and then run it in GKE after mounting some directories from GCE persistent disks (PDs). For instance, I'd like for the application's (read-write) configuration files in
/etc/<application>/ to live longer than its pods (which may restart at any time.)
The regular build puts default configuration files into
/etc/<application>/ and it is imperative that these are somehow "copied" once from the image's ephemeral disk into the PD, such that the application can start in its expected environment.
Is there a best practice for making this happen? For instance, would I have to mount PDs also in my
Dockerfile, or can I somehow request that PDs be "synced" with files from another directory/volume/disk when they are first mounted by a VM instance during deployment?