1

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)?

1
  • Put the file on Google Cloud Storage. Download the file on application start. Aug 26, 2021 at 22:13

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .