GoogleCloudPlatform / appengine-ruby

Optional integration library for the Ruby runtime for Google App Engine
Apache License 2.0
53 stars 21 forks source link

cloud build exec Permission denied #42

Closed mitsuru-komaita closed 3 years ago

mitsuru-komaita commented 3 years ago

Change the execution user in the docker container from root to a regular user and run cloud build

Dockerfile USER app

bundle exec rake appengine:exec -- bundle exec rake db:migrate. If you run Permission denied.

cloudbuild.yaml

- name: gcr.io/$PROJECT_ID/${_GAE_SERVICE}:${_COMMIT_SHA}
  entrypoint: '/bin/bash'
  args:
  - '-c'
  - |
    bundle exec rake appengine:exec  -- bundle exec rails db:migrate
  id: migrate
Step #1 - "migrate": `/builder/home` is not writable.
Step #1 - "migrate": Bundler will use `/app/tmp/bundler20210208-1-x6dat21' as your home directory temporarily.
Step #1 - "migrate": rake aborted!
Step #1 - "migrate": Errno::EACCES: Permission denied @ dir_s_mkdir - /workspace/tmp/cache

When I run it manually, I can run it without any problem.

Is there any workaround for this?