upgrading ca-certificates on a flex ruby instance

69 views
Skip to first unread message

Dave Benson

unread,
Oct 1, 2021, 2:46:56 PM10/1/21
to Google App Engine
I'm having trouble building on a google appengine instance due to ssl errors with a "Let's Encrypt" domain.  If I log into an existing instance, curl  https://gems.contribsys.com/ fails. It is fixed with apt-get update && apt-get install ca-certificates.  see this issue too.

But I can't figure out how to do that with a flex ruby instance at build time.

Any ideas?  Or is there a guide for converting an existing ruby appengine project to a custom project?

thanks,
dave

gorbov

unread,
Oct 1, 2021, 3:50:46 PM10/1/21
to Google App Engine

Hi Dave,

Glad to see that you were able to figure out a partial workaround for the existing LetsEncrypt issue. From what I understand you asked 2 specific questions:

1) How can I run `apt-get update && apt-get install ca-certificates` during build time on the Ruby runtime ?
2) How can I convert my existing Flex instance to a custom runtime ?

Let me know if understood them correctly. 

1) To answer your first question: As of right now, if you are using the Standard Ruby run time, it isn't possible to define custom build steps (which include running .sh scripts) like you otherwise would be able to with other runtimes like NodeJS for example. [1] Generally speaking, there isn't much wiggle room for custom build steps in the Standard environment. The good news is that it seems to me like you were on the right path because you mentioned using a Custom Runtime with a Flex instance [2] . With the custom Ruby runtime in GAE Flex, you can define the ``apt-get update && apt-get install ca-certificates`` in the Dockerfile as a build step. And it will be run each time a flex instance is launched by GAE.

2) To answer your second question: In order to convert an existing standard ruby GAE project to a custom runtime, all you really need to do is add the following to your app.yaml:
`` 
runtime: custom
env: flex
```
and create a Dockerfile. You can see the full details by following the quickstart [3]. However,  be aware that if you choose to use a custom runtime, there is more work required to get setup, as the previous steps that were automatically done by the standard environment must now be done manually.

I hope you found this help.

Reply all
Reply to author
Forward
0 new messages