Skip to content

Build functions locally using a runtime

Description

Before someone deploys a function to a serverless platform, it is necessary to write and debug it locally.

Proposal

Make gitlabktl func build usable locally to build functions using Docker Engine.

  1. When gitlabktl func / serverless / app build gets invoked we check if Kaniko executor binary is present.
  2. If Kaniko is present, then we just build images the old way
  3. If Kaniko is not present we check if Docker Engine is available
  4. If Docker Engine is available we build images and tag them with a registry tag (if available)
  5. We add --kaniko-build and --docker-engine-build to * build commands to make it possible to specify a desired behavior instead of doing auto-detect and Docker Engine fallback.
  6. Document in detail how to build functions locally using gitlabktl

Why it is needed?

See discussions in gitlab-org/quality/triage-serverless!2 (merged)

Edited by Daniel Gruesso
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information