Since Podman is available in Debian, I decided to play around with it for setting up a CiviCRM development environment with Buildkit. For those not familiar, buildkit is the CiviCRM tooling that helps quickly create test CiviCRM instances, useful for development and for running automated test. Podman is an alternative to Docker developed by RedHat. I decided to use it for no reason in particular. RedHat stuff tends to work well.

Install Podman on Debian

As root, install the package:

1
# apt install podman

Then edit /etc/containers/registries.conf to add the following:

1
unqualified-search-registries = ["docker.io"]

This makes podman pull unknown images from docker.io. Otherwise you can pull them manually. For example:

1
$ podman pull docker.io/library/mysql:5.7

Otherwise podman-compose will error: “mysql:5.7” did not resolve to an alias and no unqualified-search registries are defined in “/etc/containers/registries.conf”.

Getting started with Michael’s docker-compose repo

Clone the git repository:

1
$ git clone https://lab.civicrm.org/michaelmcandrew/civicrm-buildkit-docker.git

Then run the equivalent for docker-compose:

1
$ podman-compose up -d

This will take a few minutes.

Initially when I created my first CiviCRM instance, I ran into a permission denied error during the process, which I fixed by running:

1
2
$ docker-compose exec -u root civicrm bash
# chmod buildkit:buildkit /buildkit

Then create a CiviCRM instance with:

1
podman-compose exec -u buildkit civicrm civibuild create standalone-clean

You can also use other buildkit profiles, such as wp-demo instead of standalone-clean. As the name implies, wp-demo would create a WordPress site running CiviCRM, instead of just running CiviCRM (Standalone).

When ready, I could login to my instance of CiviCRM using the credentials displayed on screen.

  • The hostname generated was: http://standalone-clean.localhost:7979/
  • The files are in the current directory, under build/standalone-clean
  • The build takes sadly 1.1 GB of disk space, partly because of the size of the git repositories (over 500 MB are .git directories). I wonder if there is some git magick we could do to reduce that?

What about…

I’m still not sure about a few things:

  • Sometimes I want to expose a dev site to the internet, so that a colleague/client can test. I imagine that I can do that with nginx, but I would still need to set the hostname correctly.
  • Similarly, sometimes I need to expose to the internet to have an https certificate, because some web technologies require https (ex: for testing U2F).