Add a runtime files to a build context
Description
We currently support building custom runtimes, but runtime like Ruby or NodeJS are just a single file Dockerfile.template
.
Because it is just a single file, our initial implementation loads this repository to a memory, and generates Dockerfile
and saves it to disk. We never persist Dockerfile.template
or anything else from a runtime repository to a disk, therefore these files can not be included in a context (Kaniko / Docker Engine context) before a build starts.
This means that a Ruby runtime needs to include runtime files from a separate image https://gitlab.com/gitlab-org/serverless/runtimes/ruby/blob/master/Dockerfile.template#L1, which adds some complexity to a runtime release process and is not very flexible.
OpenFaaS does inject these runtime files into the build context.
Proposal
Inject runtime files into a build context before starting a build.
When we clone a runtime repository we should just persist it into a disk, instead of keeping all the runtime files in a memory.
It will make it easier for users / enterprises to develop their own runtimes.