Dockerfile that produces a standalone Docker image of Silverpeas 6
for testing purpose. In this image, H2 is embedded and used as the default database for Silverpeas.
No dependencies on other containers are required for its running.
Ready-to-use docker images of Silverpeas for testing purpose are available in our
Docker Hub repository.
To create an image of the latest version of Silverpeas 6:
this will build an image containing the latest pre-version of Silverpeas and the latest version of
Wildfly supported by Silverpeas, with the tag
Otherwise, to create an image of a given version of Silverpeas 6, you have to specify as argument
both the exact version of Silverpeas and the exact version of Wildfly used by this version:
$ ./build.sh 6.0 10.1.0
This will build a Docker image for Silverpeas 6.0 (not yet available) and with Wildfly 10.1.0 with
silverpeas/silverpeas-test-6.0. The versions passed as argument have to match the
available versions of both Silverpeas and Wildfly; indeed, Silverpeas and Wildfly will be downloaded
from their respective project Web site.
To run a container
silverpeas-test from an image, just do:
$ docker run --name silverpeas-test -p 8080:8000 -d silverpeas/silverpeas-test
The image exposes the 8000 port at which Silverpeas listens, and this port of the container is
mapped to the 8080 port of the host. Silverpeas takes a given amount of time to complete its
starting (about 1mn); you can check it is correctly started by consulting the logs with docker.
When the container is spawn from the image, a configuration step is performed before starting
Silverpeas. This will give the possibility to customize the configuration of Silverpeas.
For example, the locale in Silverpeas being by default in French, you can specify another locale,
say English, by passing it to the container through the
locale environment variable:
$ docker run --name silverpeas-test -p 8080:8000 -d -e locale=en silverpeas/silverpeas-test
To customize more configuration parameters in Silverpeas, please refer section
Custom configuration below.
Keep data out of the container
By default, the data are stored into the container and then they can be lost once the container is
To share the data with others containers or to keep them out of a container, you
can mount the volumes
/opt/silverpeas/h2 on the host.
You can also mount the volume
/opt/silverpeas/log in order to glance at the logs.
$ docker run --name silverpeas-test -p 8080:8000 -d \ -v silverpeas-log:/opt/silverpeas/log \ -v silverpeas-data:/opt/silverpeas/data \ -v silverpeas-h2:/opt/silverpeas/h2 \ silverpeas/silverpeas-test
The logs, the Silverpeas data and the H2 database's data are here all mounted on the host under the
to locate the labels of mounted volumes in a Docker installation. Be careful, because the volumes
have a content that was produced at the image creation, they cannot be mounted in the host's
filesystem without losing the volumes' content (the mount point overlays the pre-existing content of
In the case you wish to set some specific configuration parameters in the global Silverpeas
config.properties, set them into a
file on the host and then map to it a
in the container.
For example, to set the SMTP properties to receive email notifications, you add them into a
custom_config.properties file (for our example, in your home
SMTP_SERVER=smtp.googlemail.com SMTP_AUTHENTICATION=true SMTP_DEBUG=false SMTP_PORT=465 SMTP_USERfirstname.lastname@example.org SMTP_PASSWORD=mypassword SMTP_SECURE=true
then you map it to the container:
$ docker run --name silverpeas-test -p 8080:8000 -d \ -v /home/me/custom_config.properties:/opt/silverpeas/configuration/custom_config.properties \ silverpeas/silverpeas-test
The custom configuration file will be then parsed to add each parameters into the global Silverpeas
You can follow the activity of Silverpeas by watching the logs generated in the mounted
The output of Wildfly is redirected into the container standard output and as such it can be
watched as following:
$ docker logs -f silverpeas