Skip to content

Draft: Docker layer caching for Gitpod image

What does this Merge Request do and why?

Why

Building Gitpod image (3.26 GiB) with podman fails with OOM on 8Gb mem and 11Gb disk space - https://github.com/containers/buildah/issues/4423

The problem may be that before the layer is written, its data is either cached in memory or in /tmp dir (which is also tmpfs in memory). Then the layers data can be copied into persistent /var/tmp which is system / mount, and then the final image is also created there before moving into final location. That's my guess why podman build fails with 3x of free space compared to final image.


Gitpod image size (https://gitlab.com/gitlab-org/gitlab-development-kit/container_registry/1374346)

image

And the time to build is 77 minutes.

https://gitlab.com/gitlab-org/gitlab-development-kit/-/jobs/3239753025


What does it do

This PR splits image building into chunks. It didn't help (yet), but at least makes the image less monolithic for caching layers.

  • Moves instructions to Dockerfile for layer caching
  • Capitalizes parameter to specify which branch to build from
  • Removes GITLAB_RUNNER_DISABLE_SKEL=true as it is not the default - https://docs.gitlab.com/runner/install/linux-repository.html
  • Removes make and git install as they are already available in Gitpod base image
  • Readability changes for support/bootstrap-packages

Merge Request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Anatoli Babenia

Merge request reports