Score:1

Mount docker volume on app engine docker image

ru flag

I have a docker image that I deployed to app engine. I want to mount a volume to replace a file originally written when the image was built. I need the file to be mounted when the docker image is executed (docker run ).

Is this possible with app engine? If mounting volumes to the docker container is not possible is there any other way to replace the file on the image when the docker container is spinned up (gcloud app deploy)?

John Hanley avatar
cn flag
Put the file on Google Cloud Storage. Download the file on application start.
Score:0
de flag

Unfortunately, App Engine Flex does not have the capability to mount volumes. While it's possible to provision and use additional disk space, as shown in this documentation, it is still currently not possible to mount a disk created through the console or the CLI. Just like what John Hanley suggested, I would recommend for you to use Cloud Storage instead. See below high level steps you can use as guide (used Python runtime for this example):

  1. Import the Cloud Storage client library:
pip install --upgrade google-cloud-storage
  1. General code for downloading Cloud Storage objects

  2. Create a download function within your app that will execute once app engine spins up a new instance.

Additionally, another workaround is to mount a storage bucket to your app using gcsfuse, however there is a drawback as you may encounter privilege issues and any configurations you make could reset, as GAE Flex instances always restarts at least once a week. See this SO post as reference.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.