Building and maintaining this project is solely about the containerization of the finished Galette packages. If you want to contribute to Galette itself, take a look here.
If you just want to upgrade to the next version of Galette, all you need to do is change the version number in the Dockerfile: ARG GALETTE_VERSION=<version>
. You might also need to update the plugin versions: ARG PLUGIN_<plugin name>_VERSION=<version>
.
You can also provide these arguments as a build-args (see Building the docker image with another version of PHP and/or Galette).
After this, you should of course build and test like described in Building and testing locally. But you can also commit the change, merge it to master and start a new release in GitHub. The github action build and publish, will build and publish the image, when a new release is published.
In steps:
- Create a new branch or fork
- Update
Dockerfile
with new version(s) - Build and test locally - yeah, you really should do this ;)
- Make a pull request and await approval if you can't approve yourself.
- Normal contributers cannot proceed past this step. The next step requires elevated access to the github repository. So these steps are intended for the maintainer(s) of the project.
- Once merged, click Releases in Github
- Click "Draft new Release" button
- Select "Choose a tag" and type a version number equal to the Galette version in the
Dockerfile
. Click "Create new tag: on publish". - Update the description (copy paste from the previous release) and update latest changes, using the "Generate Release Notes" button
- Click publish release
- The github action build and publish, will build and publish the image automatically.
- Note: build and publish uses the username and a personal access token from a docker-hub user with access to the galette organisation on dockerhub. These are both stored as secrets in Github. These tokens should be the current maintainer's.
docker
is installed in your development environment.dockerd
the docker deamon is installed (and started)buildx
is installed in your development environment.
Although it's possible to build packages without dockerd
running, using buildah
, the focus here is on buildx
. You're welcome to contribute with instructions for buildah
.
- Start the docker daemon if it's not already started:
sudo dockerd
- Run hadolint (containerized):
docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < Dockerfile
- Fix errors and warnings or add them to ignore list of the hadolint configuration file if there is a good reason for that. Read more here.
- Start the docker daemon if it's not already started:
sudo dockerd
- Run the build command:
docker buildx build --platform linux/amd64 -t galette-local --load .
- replace the platform (
linux/amd64
) if you're building on another platform - replace
galette-local
with any name you would like to give your local image --load
loads the image into your local docker, so you can use it as a container image.
- replace the platform (
Follow the instructions above, but add any or both of these build args to the build command: PHP_VERSION
and/or GALETTE_VERSION
. For example:
```
docker buildx build --platform linux/amd64 -t galette-local-special \
--build-arg PHP_VERSION=8.2 \
--build-arg GALETTE_VERSION=1.0.4 \
--load .
```
- Follow the instructions above, but override the two build args:
MAIN_PACKAGE_URL
andGALETTE_RELEASE
. For example:docker buildx build --platform linux/amd64 -t galette-local-prerelease \ --build-arg MAIN_PACKAGE_URL=https://galette.eu/download/dev/ \ --build-arg GALETTE_RELEASE=galette-1.1.0-rc1-20240508-95bbbc2ede \ --load .
- If you want to add nightly official plugin releases, follow the instructions above, but add which release you want for each plugin as builds args, e.g. So for eample:
docker buildx build --platform linux/amd64 -t galette-local-prerelease \ --build-arg MAIN_PACKAGE_URL=https://galette.eu/download/dev/ \ --build-arg GALETTE_RELEASE=galette-1.1.0-rc1-20240508-95bbbc2ede \ --build-arg PLUGIN_AUTO_VERSION=dev \ --build-arg PLUGIN_EVENTS_VERSION=dev \ --build-arg PLUGIN_FULLCARD_VERSION=dev \ --build-arg PLUGIN_MAPS_VERSION=dev \ --build-arg PLUGIN_OBJECTSLEND_VERSION=dev \ --build-arg PLUGIN_PAYPAL_VERSION=dev \ --build-arg PLUGIN_ACTIVITIES_VERSION=dev \ --load .
- Start the docker daemon if it's not already started:
sudo dockerd
- Create a builder-image
docker buildx create --name mybuilder --use --bootstrap
(see "Building with Buildx" here for more details) - Run the build command:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t galette-local .
- replace
galette-local
with any name you would like to give your local image - NOTE: The build process is significantly longer than just building for your local architecture.
- replace
- Follow the same steps as in How to use this image, replacing the image name
galette/galette:latest
with your local container name, e.g.galette-local
.