apache/sling
Builds for sling-org-apache-sling-starter-docker
50K+
This module is part of the Apache Sling project.
The starter project produces feature artifacts that can be launched using the Feature Launcher.
It is not meant to be a production-ready setup, more as a way to facilitate experimenting and learning Sling.
See Releasing a new version of the Sling starter for how to create a release of this module.
NOTE: "mvn clean" deletes the "launcher" work directory in the project base directory. It is advisable to use a work directory outside of the project directory.
Build the Sling Starter using
mvn clean install
in the current directory.
Hint: You can defer stopping the instance after running the ITs with argument -Dfeature-launcher.waitForInput=true
to do some manual checks.
Start Sling backed by an Oak SegmentStore with
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-oak_tar.json
Browse Sling in:
http://localhost:8080
For MongoDB support replace the launch command with
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-oak_mongo.json
This expects a MongoDB server to be running, search for mongodb://
in the feature files for the expected URL
(currently mongodb://localhost:27017
).
The following tags are supported
12, latest
- Apache Sling Starter 12 - ( Dockerfile, Release notes )11
- Apache Sling Starter 11 - ( Dockerfile, Release notes )10
- Apache Sling Starter 10 - ( Dockerfile, Release notes )9
- Apache Sling Launchpad 9 - ( Dockerfile, Release notes )snapshot
- developments builds based on the latest version on the master branch - ( Dockerfile )The Docker image only needs the port 8080 to be exposed
$ docker run --rm -p 8080:8080 apache/sling:snapshot
By default the image launches the oak_tar
aggregate, which uses local persistence. The aggregate to launch can be selected by passing an additional argument to the image, e.g.:
$ docker run --rm -p 8080:8080 apache/sling:snapshot oak_mongo
Currently only the oak_tar
and oak_mongo
aggregates are supported.
For persisting the runtime data is is recommended to mount /opt/sling/launcher
as a volume, for instance:
$ docker volume create sling-launcher
$ docker run --rm -p 8080:8080 -v sling-launcher:/opt/sling/launcher apache/sling:snapshot
The docker/ directory contains sample files related to container-based development.
The Sling Starter will execute two suites of tests using the maven-surefire-plugin
:
By default, these are both executed when building the project against an Oak SegmentNodeStore backend.
Additionally, when the ci
profile is enabled the smoke tests are also executed in against an Oak DocumentNodeStore backend. For technical resons, the full end-to-end tests are not executed.
This module can optionally build a Docker image. This is achieved by running a build with the -Ddocker.skip=false
argument. By default, the image is built as apache/sling:snapshot
. The tag can be overrriden using the docker.label
Maven property.
$ mvn clean package -Ddocker.skip=false -Ddocker.label=local
$ docker run --rm -p 8080:8080 apache/sling:local
If you wish the extend the Sling Starter but would like to keep various application-level features out, you can
start with the nosample_base
aggregate, which contains:
For instance, launching an empty Sling Starter with segment persistence can be achieved by running
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-nosample_base.json,target/slingfeature-tmp/feature-oak_persistence_sns.json
Your own feature files can be added to the feature list.
The scripts
directory contains helper scripts that will aid with local development by simplifying the use of tools external to the Sling Starter.
docker pull apache/sling