How to install new software onto a GCP flexible environment VM

青春壹個敷衍的年華 提交于 2019-12-22 09:55:17

问题


I have a ruby on rails app running on a Google Cloud Platform VM running on the app engine flexible environment. It looks like it installs most of the software on the VM when I deploy the app with gcloud --project project-name preview app deploy I think it installs rails and other software from reading the temporary dockerfile it creates. It grabs the info for the dockerfile from the app.yaml file (I got this setup from following their tutorials).

This was working fine for me but now I need to install ImageMagick onto the server to manipulate images on the site. Normally you do this by running sudo apt-get install imagemagick from the project directory. When I SSH onto the VM I cant find the project directory so that doesn't work.

I have no idea how to get it to run sudo apt-get install imagemagick each time I make a new deploy to the site so it has the software on the new VM.

As you might be able to tell I'm not very good with the server side of things and want to know what I'm supposed to do to get new software onto the VM the right way so its always there like ruby and rails etc.. are each time I make a new deploy.


回答1:


You should use a custom Dockerfile when you need additional configuration.

To install ImageMagics you have to set runtime: custom in your app.yaml, create a Dockerfile based on default one, and add following line:

RUN apt-get update && \
    apt-get install imagemagick -y


来源:https://stackoverflow.com/questions/39062214/how-to-install-new-software-onto-a-gcp-flexible-environment-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!