Skip to content

Docker

In the Docker approach, you run all components (PHP, MySQL, buildkit) in Docker containers.

Trade-offs
  • Pro: The Docker approach works well on Linux-x86. Configuration is packaged, editable, and disposable. It is somewhat compatible with Windows and MacOS (with virtualization).
  • Con: Feels like using a remote server, so it may be difficult to integrate debuggers and other desktop tools. Only maintained on x86. For Windows/MacOS hosts, virtualization hinders performance (esp file I/O).

Requirements

  • Docker and Docker Compose
  • Intel/AMD CPU (The Docker core is compatible with other CPUs, but there are currently compatiblity issues with specific containers.)

Download

You can download one of the following projects to run buildkit within a Docker container:

Note

There are different versions of Buildkit on Docker. Michael McAndrew's seems to be the easiest to get started with on Linux.

Download buildkit on docker on ubuntu

After install docker and docker-compose, download the container descriptions:

git clone https://lab.civicrm.org/michaelmcandrew/civicrm-buildkit-docker.git
cd civicrm-buildkit-docker
sudo docker-compose up -d

Now you are ready to go.

To create a new site with buildkit run the following command:

docker-compose exec -u buildkit civicrm civibuild create dmaster --url http://localhost:8080

Alternative you can login into the conatiner and run the commands from there:

docker-compose exec -u buildkit civicrm bash

More information is in the Readme: https://lab.civicrm.org/michaelmcandrew/civicrm-buildkit-docker/-/blob/master/README.md

Next steps

Once you are able to run commands on the civicrm container, you can move on to using using civibuild.