Skip to content

Latest commit

 

History

History
86 lines (73 loc) · 6.13 KB

CONTRIBUTING.md

File metadata and controls

86 lines (73 loc) · 6.13 KB

Galette Docker project

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.

Updating to next Galette version

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:

  1. Create a new branch or fork
  2. Update Dockerfile with new version(s)
  3. Build and test locally - yeah, you really should do this ;)
  4. 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.
  5. Once merged, click Releases in Github
  6. Click "Draft new Release" button
  7. Select "Choose a tag" and type a version number equal to the Galette version in the Dockerfile. Click "Create new tag: on publish".
  8. Update the description (copy paste from the previous release) and update latest changes, using the "Generate Release Notes" button
  9. Click publish release
  10. 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.

Building and testing locally

Prerequisites

  • 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.

Linting

  1. Start the docker daemon if it's not already started: sudo dockerd
  2. Run hadolint (containerized): docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < Dockerfile
  3. 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.

Building the docker image locally

  1. Start the docker daemon if it's not already started: sudo dockerd
  2. 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.

Building the docker image with another version of PHP and/or Galette

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 .
```

Building the docker image with Galette pre-releases

  • Follow the instructions above, but override the two build args: MAIN_PACKAGE_URL and GALETTE_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 .
    

Building for multiple architecures locally

  1. Start the docker daemon if it's not already started: sudo dockerd
  2. Create a builder-image docker buildx create --name mybuilder --use --bootstrap (see "Building with Buildx" here for more details)
  3. 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.

Running the docker image locally

  1. 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.