monday-consulting / firstspirit-docker

FirstSpirit in a Docker Container
Apache License 2.0
4 stars 2 forks source link

FirstSpirit in a Container

THIS PROJECT IS NOT AN OFFICIAL PRODUCT BY Crownpeak Technology GmbH. It is maintained and provided by Monday Consulting to the FirstSpirit Community

What is FirstSpirit

FirstSpirit ist ein kommerzielles Content-Management-System, das von der Dortmunder Crownpeak Technology GmbH, einem Tochterunternehmen der CrownPeak Inc., seit 1999 entwickelt wurde. Die erste stabile Version 0.9 wurde am 7. Juni 2000 herausgegeben. Das System ist in Java entwickelt und wird für GNU/Linux, Solaris (x86, Sparc), AIX und Windows angeboten.

TL;DR

docker run -d -v $(pwd)/config/fs-license.conf:/opt/firstspirit5/conf/fs-license.conf --name FirstSpirit firstspirit/firstspirit:[TAG]

You can find the available configuration options in the Environment Variables section.

Supported platforms

The following os architectures are tested by Monday Consulting:

Usage examples

with port mapping

docker run -d -v $(pwd)/config/fs-license.conf:/opt/firstspirit5/conf/fs-license.conf -p 8000:8000 -p 1088:1088 --name CONTAINER_NAME --hostname=localhost YOUR_REG_HERE/firstspirit/firstspirit:[TAG]

with overriding HOST and HTTP_PORT in fs-server.conf

docker run -d -v $(pwd)/config/fs-license.conf:/opt/firstspirit5/conf/fs-license.conf -p 80:8000 -p 1088:1088 --name CONTAINER_NAME -e EXT_HOSTNAME=localhost -e EXT_PORT=80 YOUR_REG_HERE/firstspirit/firstspirit:[TAG]

Creating your own images

The Dockerfiles are multi-stage builds. For creating your own images you need a download url and credentials. These are mandatory and must be provided by build-args . In the project root folder run

docker build -f jdk17/Dockerfile --no-cache --build-arg FS_DOWNLOAD_SERVER=YOUR_URL_HERE --build-arg FS_DOWNLOAD_SERVER_USERNAME=YOUR_USERNAME --build-arg FS_DOWNLOAD_SERVER_PASSWORD=YOUR_PASSWORD --build-arg IMAGE_CREATED=$(date +%FT%T%Z) -t your-registry.local/firstspirit/firstspirit_debug:YOUR-TAG-jdk17 .

Image flavours

Currently, there is one mayor flavor, as JDK 11 is not supported for FirstSpirit versions 2023.09 and newer.

The mayor flavor is addressed by its respective Dockerfile. Choose your flavors by providing the -f flag to the build command. E.g. for JDK 17

docker build -f jdk17/Dockerfile ...

By default, the image is created with debug properties so a developer can remote debug the FirstSpirit server. If you don't want this option you have to provide the base target to the docker build. E.g. for JDK 17

docker build -f jdk17/Dockerfile --target base ...

For a complete set of images you have run 2 commands:

docker build -f jdk17/Dockerfile --no-cache --build-arg FS_DOWNLOAD_SERVER=YOUR_URL_HERE --build-arg FS_DOWNLOAD_SERVER_USERNAME=YOUR_USERNAME --build-arg FS_DOWNLOAD_SERVER_PASSWORD=YOUR_PASSWORD --build-arg IMAGE_CREATED=$(date +%FT%T%Z) -t your-registry.local/firstspirit/firstspirit_debug:YOUR-TAG_GOES-HERE-jdk17 .
docker build -f jdk17/Dockerfile --target base --build-arg FS_DOWNLOAD_SERVER=YOUR_URL_HERE --build-arg FS_DOWNLOAD_SERVER_USERNAME=YOUR_USERNAME --build-arg FS_DOWNLOAD_SERVER_PASSWORD=YOUR_PASSWORD --build-arg IMAGE_CREATED=$(date +%FT%T%Z) -t your-registry.local/firstspirit/firstspirit:YOUR-TAG_GOES-HERE-jdk17 .

Recommended tagging

The image tagging scheme should be

YOUR_REGISTRY/YOUR_PROJECT/firstspirit[_debug]:(FS-VERSION)-(JDK-VERSION)

A complete set would be:

Build multi-platform images

See the official documentation for more details.

  1. Get the QEMU kernel images docker run --privileged --rm tonistiigi/binfmt --install all
  2. Create a new builder and run it docker buildx create --name <YOUR_BUILDER_NAME_HERE> --driver docker-container --bootstrap
  3. Use the builder docker buildx use <YOUR_BUILDER_NAME_HERE>
  4. Run your build with buildx (BuildKit), pushes the image immediately docker buildx build --platform linux/arm64,linux/amd64 -f jdk17/Dockerfile ... -t <YOUR_IMAGE_TAG_HERE> --push .
  5. Reset builder to default docker buildx use default
  6. Remove builder docker buildx rm <YOUR_BUILDER_NAME_HERE>

Running tests

CST tests

To run the Container Structure Tests you need to install the CLI first. Then you can run the tests with

container-structure-test test --image firstspirit/firstspirit_debug:[YOUR_TAG] --config unit-test.jdk17.yaml

for running test of a JDK 17 image

InSpec integration tests

To run Chef InSpec integration tests you need to install the CLI first. Then you can run the tests with:

docker run --rm ... # Start a container based on the to test image
docker ps -q # Get the running container id
inspec exec ./inspec-tests --input firstspirit_version='5.2.230411' -t docker://CONTAINER_ID # Run the tests

Configuration

Environment variables

The FirstSpirit instance can be customized by specifying environment variables on the first run. The following environment values are provided to custom FirstSpirit:

Build variables

The image build process can be customized by specifying the build-args at build time.

Contributing

We'd love for you to contribute to those container images. You can request new features by creating an issue, or submit a pull request with your contribution.

Legal Notices

FirstSpirit is a product of Crownpeak Technology GmbH, Dortmund, Germany.

Disclaimer

This document is provided for information purposes only. Monday Consulting may change the contents hereof without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. Monday Consulting specifically disclaims any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. The technologies, functionality, services, and processes described herein are subject to change without notice.