Verified Commit eb9e2684 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

build Docker image for release 4.1.5

parent ba3bb5ea
Pipeline #8535 passed with stage
in 4 minutes and 12 seconds
include:
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'docker-image.yml'
variables:
DOCKER_TLS_CERTDIR: ""
stages:
- publish
FROM debian:buster-slim AS build
ARG VERSION=4.1.5
WORKDIR /
RUN apt-get -qq update && \
apt-get -qq install wget unzip && \
apt-get clean
RUN wget -q https://github.com/cantaloupe-project/cantaloupe/releases/download/v${VERSION}/cantaloupe-${VERSION}.zip -O temp.zip && \
unzip temp.zip && \
mv cantaloupe-${VERSION} cantaloupe && \
mv cantaloupe/deps/Linux-x86-64/lib cantaloupe/lib && \
rm -r cantaloupe/deps && \
rm cantaloupe/cantaloupe.properties.sample
ADD ./cantaloupe.properties /cantaloupe/cantaloupe.properties
FROM openjdk:11-jre-slim
ENTRYPOINT ["/home/cantaloupe/run.sh", "4.1.5"]
CMD ["-Dcantaloupe.config=/home/cantaloupe/app/cantaloupe.properties","-Djava.library.path=/home/cantaloupe/app/lib", "-Xmx2g"]
ARG HTTP_PORT=8182
HEALTHCHECK --start-period=30s CMD curl -sf 0.0.0.0:${HTTP_PORT} -o /dev/null || exit 1
RUN useradd cantaloupe
WORKDIR /home/cantaloupe
VOLUME ["/home/cantaloupe/images"]
COPY --chown=cantaloupe --from=build /cantaloupe/ app/
ADD --chown=cantaloupe ./run.sh run.sh
RUN apt-get -qq update && \
apt-get -qq install curl && \
apt-get clean
USER cantaloupe
# Cantaloupe on Docker
provides Dockerfiles for creating dockerized versions of Cantaloupe
\ No newline at end of file
This repository provides the Dockerfiles for creating Docker images of
[Cantaloupe](https://cantaloupe-project.github.io), a IIIF imageserver.
## Version management
This repository will eventually comprise Dockerfiles for different releases of
the application. In order to build an image out of a specific version, use the
respective branch (e.g. `4.1.5`). The Docker image tags correspond to the
branch names / version numbers, so in order to use the 4.1.5-version of the
application, pull the image with tag `4.1.5`. The `latest` tag is identical to
the last development version, which means reflecting the `develop` branch of
the Cantaloupe [repository](https://github.com/cantaloupe-project/cantaloupe/)
as well as of this repository. This latest version in insofar special because
the Docker image is directly built from the sources while all other releases
use the already compiled code (see
[releases](https://github.com/cantaloupe-project/cantaloupe/) section of the
Cantaloupe repository for more information).
## Configuration
You have different options to change the default configuration of Cantaloupe.
Notice that some changes can affect the overall working of the container
(e.g. changing the port used by Cantaloupe)
1. Change the `cantaloupe.properties` file in this directory and rebuild the
image
2. Mount your own `cantaloupe.properties` file on container startup by
providing the argument
`-v<path_to_your_config>:/home/cantaloupe/app/cantaloupe.properties`
3. Selectively override properties by setting appropriate environment
variables on container startup (`-e<key>:<value>). The key translate to
uppercase letters, `.` being replaced by `_` (e.g. `https.key_store_path` ->
`HTTPS_KEY_STORE_PATH`).
```sh
docker run --name cantaloupe --rm -d -p8182:8182 -v<path_to_host_image_folder>:/home/cantaloupe/images cantaloupe:<tag>
```
This diff is collapsed.
#!/bin/bash
BASEDIR=/home/cantaloupe/app
# CONFIGPATH=
if [ ! -f "$BASEDIR/cantaloupe.properties" ]; then
CONFIGPATH="$BASEDIR/cantaloupe.properties.sample"
else
CONFIGPATH="$BASEDIR/cantaloupe.properties"
fi
while IFS= read -r line
do
if echo $line | grep -q "^[^#].\+"; then
KEY=`echo "$line" | cut -d"=" -f1`
ENVVAR=`echo $KEY | tr '[:lower:]' '[:upper:]' | sed -e 's/\./_/g'`
if [[ -v `echo $ENVVAR` ]]; then
echo "${KEY} = ${!ENVVAR}" >> $BASEDIR/temp.properties
else
echo "$line" >> $BASEDIR/temp.properties
fi
fi
done < $CONFIGPATH
mv $BASEDIR/temp.properties $BASEDIR/overridden.properties
echo "$BASEDIR/cantaloupe-${1}.war"
java -jar ${@:2} $BASEDIR/cantaloupe-${1}.war
java ${@:2} -jar /home/cantaloupe/app/cantaloupe-${1}.war
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment