Skip to content

Commit

Permalink
PHP version and Galette version can now be provided as parameters. Ga…
Browse files Browse the repository at this point in the history
…lette RC-versions and other pre-releases can now be baked into a Docker image
  • Loading branch information
grasdk committed May 8, 2024
1 parent aca4862 commit 87e1f66
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ Although it's possible to build packages without `dockerd` running, using [`buil
* 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
1. 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
1. 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 .`

### 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](https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/) for more details)
Expand Down
39 changes: 19 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
ARG PHP_VERSION=8.2

# Using PHP-Apache image
FROM php:8.2-apache
FROM php:${PHP_VERSION}-apache
ARG PHP_VERSION
ARG GALETTE_VERSION=1.0.4
ARG GALETTE_RELEASE=galette-${GALETTE_VERSION}

# Maintained by GrasDK for Galette community
LABEL maintainer="GrasDK"
# @author Hiob
# @author GrasDK

LABEL phpversion="8.2"
ARG galetteversion="1.0.4"

## Plugins versions
ARG plugin_auto_version="2.0.0"
Expand All @@ -17,17 +20,16 @@ ARG plugin_maps_version="2.0.0"
ARG plugin_objectslend_version="2.0.0"
ARG plugin_paypal_version="2.0.0"

LABEL version=$galetteversion
LABEL description="PHP $phpversion / Apache 2 / Galette $galetteversion"
LABEL description="PHP $PHP_VERSION / Apache 2 / $GALETTE_RELEASE"

LABEL org.opencontainers.image.source=https://github.com/galette-community/docker
LABEL org.opencontainers.image.description="Galette is a membership management web application towards non profit organizations."
LABEL org.opencontainers.image.licenses=GPL-3.0-or-later

ARG main_package_url="https://galette.eu/download/"
ARG plugin_package_url="https://galette.eu/download/plugins/"
#ARG main_package_url="https://download.tuxfamily.org/galette/"
#ARG plugin_package_url="https://download.tuxfamily.org/galette/plugins/"
ARG MAIN_PACKAGE_URL="https://galette.eu/download/"
ARG PLUGIN_PACKAGE_URL="https://galette.eu/download/plugins/"
#ARG MAIN_PACKAGE_URL="https://download.tuxfamily.org/galette/"
#ARG PLUGIN_PACKAGE_URL="https://download.tuxfamily.org/galette/plugins/"

# Install APT dependencies
RUN a2enmod rewrite
Expand Down Expand Up @@ -58,9 +60,6 @@ RUN sed -i "s/galette.localhost/galette.${HOSTNAME}/" /etc/apache2/sites-availab
&& a2dissite -- * && a2ensite vhost.conf

# ENVIRONMENT VARIABLES
## Galette version
ENV GALETTE_VERSION=$galetteversion

## Galette ENV
ENV GALETTE_CONFIG /var/www/galette/config
ENV GALETTE_DATA /var/www/galette/data
Expand All @@ -82,33 +81,33 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Installation Galette and plugins
## Galette
WORKDIR /usr/src
RUN wget --progress=dot:giga ${main_package_url}galette-${GALETTE_VERSION}.tar.bz2
RUN tar jxvf galette-${GALETTE_VERSION}.tar.bz2; mv galette-${GALETTE_VERSION}/galette/* ${GALETTE_INSTALL} ; rm galette-${GALETTE_VERSION}.tar.bz2
RUN wget --progress=dot:giga ${MAIN_PACKAGE_URL}${GALETTE_RELEASE}.tar.bz2
RUN tar jxvf ${GALETTE_RELEASE}.tar.bz2; mv ${GALETTE_RELEASE}/galette/* ${GALETTE_INSTALL} ; rm ${GALETTE_RELEASE}.tar.bz2

## Official plugins
WORKDIR ${GALETTE_INSTALL}/plugins
### Auto
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-auto-${plugin_auto_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-auto-${plugin_auto_version}.tar.bz2
RUN tar jxvf galette-plugin-auto-${plugin_auto_version}.tar.bz2; rm galette-plugin-auto-${plugin_auto_version}.tar.bz2; mv galette-plugin-auto-${plugin_auto_version} plugin-auto

### Events
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-events-${plugin_events_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-events-${plugin_events_version}.tar.bz2
RUN tar jxvf galette-plugin-events-${plugin_events_version}.tar.bz2; rm galette-plugin-events-${plugin_events_version}.tar.bz2; mv galette-plugin-events-${plugin_events_version} plugin-events

### FullCard
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-fullcard-${plugin_fullcard_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-fullcard-${plugin_fullcard_version}.tar.bz2
RUN tar jxvf galette-plugin-fullcard-${plugin_fullcard_version}.tar.bz2; rm galette-plugin-fullcard-${plugin_fullcard_version}.tar.bz2; mv galette-plugin-fullcard-${plugin_fullcard_version} plugin-fullcard

### Maps
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-maps-${plugin_maps_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-maps-${plugin_maps_version}.tar.bz2
RUN tar jxvf galette-plugin-maps-${plugin_maps_version}.tar.bz2; rm galette-plugin-maps-${plugin_maps_version}.tar.bz2; mv galette-plugin-maps-${plugin_maps_version} plugin-maps

### ObjectsLend
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-objectslend-${plugin_objectslend_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-objectslend-${plugin_objectslend_version}.tar.bz2
RUN tar jxvf galette-plugin-objectslend-${plugin_objectslend_version}.tar.bz2; rm galette-plugin-objectslend-${plugin_objectslend_version}.tar.bz2; mv galette-plugin-objectslend-${plugin_objectslend_version} plugin-objectslend

### Paypal
RUN wget --progress=dot:giga ${plugin_package_url}galette-plugin-paypal-${plugin_paypal_version}.tar.bz2
RUN wget --progress=dot:giga ${PLUGIN_PACKAGE_URL}galette-plugin-paypal-${plugin_paypal_version}.tar.bz2
RUN tar jxvf galette-plugin-paypal-${plugin_paypal_version}.tar.bz2; rm galette-plugin-paypal-${plugin_paypal_version}.tar.bz2; mv galette-plugin-paypal-${plugin_paypal_version} plugin-paypal

# CRON Auto-Reminder
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ You're done.
## How to use this image AND a mariadb image using Docker Compose
1. Copy [`docker-compose/galette-and-mariadb/docker-compose.yml`](docker-compose/galette-and-mariadb/docker-compose.yml) and [`docker-compose/galette-and-mariadb/.env`](docker-compose/galette-and-mariadb/.env) to the folder, where you want to persist your configuration.
- Note: The official mariadb docker image LTS version `10.11` is currently not released for `arm/v7` so it can't be used for e.g. RaspBerry Pi 32 bit. However, you can switch to this unofficial mariadb-image instead: `jbergstroem/mariadb-alpine:10.11.5`.
2. Edit the `env` file to set your database configuration. **Don't** skip this.
3. Continue with the rest of the steps above
Expand Down

0 comments on commit 87e1f66

Please sign in to comment.