# בונה תמונות Discourse עבור צינורות Gitlab CI/CD

**URL:** <https://meta.discourse.org/t/discourse-image-builder-for-gitlab-ci-cd-pipelines/261857>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [16 באפריל,‏ 2023,‏ 12:44pm UTC](https://meta.discourse.org/t/discourse-image-builder-for-gitlab-ci-cd-pipelines/261857 "2023-04-16T12:44:10Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![mkbrechtel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mkbrechtel/32/295242_2.png) [@mkbrechtel](https://meta.discourse.org/u/mkbrechtel)\
**Post date:** [16 באפריל,‏ 2023,‏ 12:44pm UTC](https://meta.discourse.org/t/discourse-image-builder-for-gitlab-ci-cd-pipelines/261857/1 "2023-04-16T12:44:10Z")

</div>

Heyho!

We created a repository called [RPS Discourse Image Builder](https://gitlab.com/idcohorts/rps/discourse-image-builder) is used to create a Discourse OCI image. I think this might be helpful to some people looking here. We mainly did this so we don’t need to wait for the discourse deploy which takes long and to be able to version pin discourse reliably.

We wrote a script that uses the discourse\_docker repo to build the image with the stable version in the most general way possible.

There is also a docker compose file that brings up the databases required for building and the discourse image for testing and runs it for local development. This can run on a GitLab runner with the `shell` executor, but you need a system with a `docker-compose` version that supports profiles.

## Approach

The build script should be run within our CI/CD pipelines so we can easily update the version so further adjustments are done in different repos with Dockerfiles that are based on the image created by this repo.

## Background

Discourse is a very nice piece of software, but it is not very easy to deploy and to version pin. This repository is used to create a docker image that can be used to deploy discourse.

The problem is that discourse has a very unique way of building their docker images. The Discourse developers expect you to build the image on the target machine with their discourse\_docker repo.

There have been a lengthy discussions about this on the forum, TL;DR: The discourse lead developers refuse to support a public docker image that can be used to deploy discourse. They want to keep the discourse\_docker repo as the only official way to deploy discourse.

The main disadvatages for this approach are:

- It is not possible, from our experience, to version pin discourse reliably.
- It takes a long time to build the image and when the image is built the service is not available. Also discourse has the longest DevOps iteration cycle of all the services we support.
- Databases are managed in a different way than for usual docker based projects.
- The official Discourse deployment story is incompatible with OCI based development workflows and deployments, like Kubernetes or even Docker-Compose.
- The discourse\_docker launcher makes a lot of assumptions about the environment it is running in. For example it refuses to run on rootless Podman with an error about missing storage volumes without being able to bypass this with an argument or env var.

---

_[View the full topic](https://meta.discourse.org/t/discourse-image-builder-for-gitlab-ci-cd-pipelines/261857)._
