This page (revision-32) was last changed on 03-Dec-2021 18:30 by Klaus Thevessen 

This page was created on 08-Mar-2015 14:17 by unknown

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Version Date Modified Size Author Changes ... Change note
32 03-Dec-2021 18:30 12 KB Klaus Thevessen to previous
31 28-Nov-2021 13:12 11 KB Klaus Thevessen to previous | to last apache/jspwiki must in the first line.
30 11-Sep-2021 15:05 11 KB Juan Pablo to previous | to last Fix docker hub image link
29 11-Sep-2021 13:01 11 KB Juan Pablo to previous | to last Added section on ENV variables
28 11-Sep-2021 12:01 11 KB Juan Pablo to previous | to last Examples use apache/jspwiki docker image
27 11-Jan-2021 21:44 11 KB Juan Pablo to previous | to last fix unwanted line-wrapping
26 03-Jan-2021 15:19 11 KB Carl Marcum to previous | to last fixed non-printable characters causing unwanted line-wrapping
25 03-Jan-2021 15:18 11 KB Carl Marcum to previous | to last fixed non-printable characters causing unwanted line-wrapping
24 01-Jan-2021 20:58 11 KB Carl Marcum to previous | to last fixed unintential line breaks in run example explaination
23 01-Jan-2021 19:39 11 KB Juan Pablo to previous | to last fix typo
22 01-Jan-2021 19:31 11 KB Juan Pablo to previous | to last add proposed changes from ML
21 09-Jan-2017 18:15 10 KB Harry Metske to previous | to last
Incoming links Outgoing links

Difference between version and

At line 3 changed 2 lines
JSPWiki can be used with [Docker|https://docs.docker.com]. Docker images
can be built from source or you can use a pre-built official image.
JSPWiki can be used with [Docker|https://docs.docker.com]. Docker images can be built from source or you can use a pre-built official image.
At line 10 changed 6 lines
The default JSPWiki Docker image uses the official Docker Community
supported [Apache Tomcat 9
image|https://github.com/docker-library/tomcat/blob/b9416beec5364c00694595d6f3c61b09e764113c/9.0/jdk11/openjdk-buster/Dockerfile]
which is based on the [OpenJDK
11|https://github.com/docker-library/openjdk/blob/20450f7a60b8db7aafd491a5ea55c6a3548138c6/11/jdk/buster/Dockerfile]
built on Debian Buster.
The default JSPWiki Docker image uses the official Docker Community supported [Apache Tomcat 9 image|https://github.com/docker-library/tomcat/blob/b9416beec5364c00694595d6f3c61b09e764113c/9.0/jdk11/openjdk-buster/Dockerfile] which is based on the [OpenJDK 11|https://github.com/docker-library/openjdk/blob/20450f7a60b8db7aafd491a5ea55c6a3548138c6/11/jdk/buster/Dockerfile] built on Debian Buster.
At line 17 changed 2 lines
JSPWiki is built from source using [Apache
Maven|http://maven.apache.org/] during the image build process.
JSPWiki is built from source using [Apache Maven|http://maven.apache.org/] during the image build process.
At line 22 changed 4 lines
To use the pre-built image or build one from source you only need a
[Docker Engine|https://docs.docker.com/engine/]. See the [installation
instructions|http://docs.docker.com/installation/] on the docker site
for details.
To use the pre-built image or build one from source you only need a [Docker Engine|https://docs.docker.com/engine/]. See the [installation instructions|http://docs.docker.com/installation/] on the docker site for details.
At line 28 changed 2 lines
To download it locally from the [docker
hub|https://registry.hub.docker.com/u/metskem/docker-jspwiki/].
To download it locally from the [docker hub|https://registry.hub.docker.com/r/apache/jspwiki/].
At line 32 changed one line
$ docker pull metskem/docker-jspwiki
$ docker pull apache/jspwiki
At line 36 changed one line
$ docker run -d -p 8080:8080 --name jspwiki metskem/docker-jspwiki
$ docker run -d -p 8080:8080 --name jspwiki apache/jspwiki
At line 41 changed 5 lines
* __-p 8080:8080__ - bind the host port (8080) to the container port
(8080). JSPWiki always runs on port 8080 inside the container.
* __--name jspwiki__ - the new docker container will get the name
''jspwiki'' (instead of a generated container name)
* __metskem/docker-jspwiki__ - the name of the image to run
* __-p 8080:8080__ - bind the host port (8080) to the container port (8080). JSPWiki always runs on port 8080 inside the container.
* __--name jspwiki__ - the new docker container will get the name ''jspwiki'' (instead of a generated container name)
* __apache/jspwiki__ - the name of the image to run
At line 49 changed 5 lines
From the source root directory that contains the Dockerfile. The
example uses a {{$version}} variable because the version is referred to
multiple times. It is optional and can be replaced by any version number
you would like to use. If you do not specify a version with the tag name
it will default to 'latest'.
From the source root directory that contains the Dockerfile. The example uses a {{$version}} variable because the version is referred to multiple times. It is optional and can be replaced by any version number you would like to use. If you do not specify a version with the tag name it will default to {{latest}}.
At line 55 changed 2 lines
Watch out for the space and period at the end which means the current
directory.
Watch out for the space and period at the end which means the current directory.
At line 71 changed 2 lines
Just point your browser at [http://localhost:8080/], that should give
you a working wiki right away !
Just point your browser at [http://localhost:8080/], that should give you a working wiki right away!
At line 74 changed 3 lines
To see the list of running containers use {{docker ps}} or {{docker
container ls}} and {{docker ps -a}} or {{docker container ls -a}} will
show all containers running and stopped.
To see the list of running containers use {{docker ps}} or {{docker container ls}} and {{docker ps -a}} or {{docker container ls -a}} will show all containers running and stopped.
At line 79 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 4
minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 4 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp jspwiki
At line 85 changed 3 lines
You can also execute commands inside the jspwiki container with the
docker exec command and, for example, look at the last 5 lines in
/var/jspwiki/logs/jspwiki.log :
You can also execute commands inside the jspwiki container with the docker exec command and, for example, look at the last 5 lines in {{/var/jspwiki/logs/jspwiki.log}}:
At line 90 changed 16 lines
2016-03-28 09:34:35,070 [localhost-startStop-1] INFO
org.apache.wiki.util.UtilJ2eeCompat - apache tomcat detected
2016-03-28 09:34:35,073 [localhost-startStop-1] INFO
org.apache.wiki.ajax.WikiAjaxDispatcherServlet -
WikiAjaxDispatcherServlet initialized.
2016-03-28 09:34:35,075 [localhost-startStop-1] INFO
org.apache.wiki.WikiServlet - WikiServlet initialized.
2016-03-28 09:34:38,054 [http-nio-8080-exec-1] INFO
org.apache.wiki.util.PropertyReader JSPWiki:/
JSPWiki:http://localhost:8080/ - No jspwiki.custom.config defined for
this context, looking for custom properties file with default name of:
/jspwiki-custom.properties
2016-03-28 09:34:38,057 [http-nio-8080-exec-1] INFO
org.apache.wiki.util.PropertyReader JSPWiki:/
JSPWiki:http://localhost:8080/ - No custom property file found, relying
on JSPWiki defaults.
2016-03-28 09:34:35,070 [localhost-startStop-1] INFO org.apache.wiki.util.UtilJ2eeCompat - apache tomcat detected
2016-03-28 09:34:35,073 [localhost-startStop-1] INFO org.apache.wiki.ajax.WikiAjaxDispatcherServlet - WikiAjaxDispatcherServlet initialized.
2016-03-28 09:34:35,075 [localhost-startStop-1] INFO org.apache.wiki.WikiServlet - WikiServlet initialized.
2016-03-28 09:34:38,054 [http-nio-8080-exec-1] INFO org.apache.wiki.util.PropertyReader JSPWiki:/JSPWiki:http://localhost:8080/ - No jspwiki.custom.config defined for this context, looking for custom properties file with default name of: /jspwiki-custom.properties
2016-03-28 09:34:38,057 [http-nio-8080-exec-1] INFO org.apache.wiki.util.PropertyReader JSPWiki:/JSPWiki:http://localhost:8080/ - No custom property file found, relying on JSPWiki defaults.
At line 110 changed 3 lines
To stop the container, simply issue the {{docker stop}} or {{docker
container stop}} command against the containerid (or container name if
you gave it a name during first run).
To stop the container, simply issue the {{docker stop}} or {{docker container stop}} command against the containerid (or container name if you gave it a name during first run).
At line 116 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 6
minutes ago Up 6 minutes 0.0.0.0:8080->8080/tcp jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 6 minutes ago Up 6 minutes 0.0.0.0:8080->8080/tcp jspwiki
At line 123 changed 2 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
At line 126 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 6
minutes ago Exited (143) 4 seconds ago jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 6 minutes ago Exited (143) 4 seconds ago jspwiki
At line 132 changed 3 lines
You can restart it with the {{docker start}} or {{docker container
start}} command, you have to find the containerid with the {{docker ps
-a}} command first , (or simply use the container name if you gave the
You can restart it with the {{docker start}} or {{docker container start}} command, you have to find the containerid with the {{docker ps -a}} command first , (or simply use the container name if you gave the
At line 140 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 7
minutes ago Up 5 seconds 0.0.0.0:8080->8080/tcp jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 7 minutes ago Up 5 seconds 0.0.0.0:8080->8080/tcp jspwiki
At line 146 changed 3 lines
As you will notice, after a stop/start you still have the data (pages)
that were created after the first container start. %%small (you can
check easily with the Recent Changes page) %%
As you will notice, after a stop/start you still have the data (pages) that were created after the first container start. %%small (you can check easily with the Recent Changes page) %%
At line 152 changed 3 lines
If you want to get rid of the container (and all of the data in it !)
you first should stop it, then you can remove it with the {{docker rm}}
or {{docker container rm}} command %%small (or use docker rm -f to
If you want to get rid of the container (and all of the data in it!) you first should stop it, then you can remove it with the {{docker rm}} or {{docker container rm}} command %%small (or use docker rm -f to
At line 158 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 9
minutes ago Up About a minute 0.0.0.0:8080->8080/tcp jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 9 minutes ago Up About a minute 0.0.0.0:8080->8080/tcp jspwiki
At line 165 changed 4 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5f0f5b0b5996 metskem/docker-jspwiki "/usr/local/tomcat/bi" 9
minutes ago Exited (143) 6 seconds ago jspwiki
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f0f5b0b5996 apache/jspwiki "/usr/local/tomcat/bi" 9 minutes ago Exited (143) 6 seconds ago jspwiki
At line 172 changed 3 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
At line 177 changed 2 lines
Note that all your data is lost when you remove the container. (You can
keep data apart using Docker Volumes, see next paragraph)
Note that all your data is lost when you remove the container. (You can keep data apart using Docker Volumes, see next paragraph)
At line 122 added 8 lines
!! ENV variables
Docker's Environment variables will be passed to the running instance of JSPWiki inside the container, which is able to translate them to something that JSPWiki will understand, i.e., {{ENV jspwiki_use_external_logconfig true}} will be understood by the {{WikiEngine}} as {{jspwiki.use.external.logconfig=true}}, {{ENV jspwiki_pageProvider VersioningFileProvider}} as {{jspwiki.pageProvider VersioningFileProvider}}, and so on.
%%bg-info
%%label-info Tip%% you can use {{ENV jspwiki_custom_config $PATH_TO_FILE_INSIDE_DOCKER_VOLUME}} to load your {{jspwiki-custom.properties}} file to load your JSPWiki customizations, see Persisting Data section below to get a grasp on how to do it.
%%
At line 182 changed 7 lines
If you use docker to run JSPWiki only for quick test purposes, you
probably are not interested in keeping the data (created/changed pages,
registered users, logfiles).\\
But you can also run a JSPWiki docker container in production-like
environments where you want to keep your data even after you removed a
container. \\As an example you might sometimes want to run a newer
version of your JSPWiki Docker container.
If you use docker to run JSPWiki only for quick test purposes, you probably are not interested in keeping the data (created/changed pages, registered users, logfiles).\\ But you can also run a JSPWiki docker container in production-like environments where you want to keep your data even after you removed a container. \\As an example you might sometimes want to run a newer version of your JSPWiki Docker container.
At line 191 changed 2 lines
To begin with the default pages you can copy them from the source tree
into a host OS directory used to persist the data.
To begin with the default pages you can copy them from the source tree into a host OS directory used to persist the data.
At line 194 changed 2 lines
$ cp ./jspwiki-wikipages/en/src/main/resources/*
<path-to-your>/jspwiki-pages/
$ cp ./jspwiki-wikipages/en/src/main/resources/* <path-to-your>/jspwiki-pages/
At line 139 added one line
At line 198 changed 2 lines
To use the data outside of the container, you can use the {{--volume}}
switch when you startup the container :
To use the data outside of the container, you can use the {{--volume}} switch when you startup the container :
At line 201 changed 4 lines
$ docker run -d -p 8080:8080 --env="jspwiki_baseURL=http://localhost/"
--name jspwiki_8080
--volume="<path-to-your>/jspwiki-pages:/var/jspwiki/pages"
metskem/docker-jspwiki
$ docker run -d -p 8080:8080 --env="jspwiki_baseURL=http://localhost/" --name jspwiki_8080 --volume="<path-to-your>/jspwiki-pages:/var/jspwiki/pages" apache/jspwiki
At line 208 changed 2 lines
This way you will get your pages in a directory on the host OS in
<path-to-your>/jspwiki-pages.\\
This way you will get your pages in a directory on the host OS in {{<path-to-your>/jspwiki-pages}}. You can use the same technique to store the attachments, the log files, the {{jspwiki-custom.properties}} file, etc.
At line 149 added 23 lines
__jspwiki.policy + userdatabase.xml (wiki-users) + server.xml__
{{{
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64560e4e56c2 apache/jspwiki "/usr/local/tomcat/b…" 5 days ago Up 6 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp jspwiki_8080
$ docker exec -it jspwiki_8080 /bin/bash
root@64560e4e56c2:/usr/local/tomcat#
root@64560e4e56c2:/usr/local/tomcat/webapps/ROOT/WEB-INF# ls -l
-rw-r--r-- 1 root root 5713 Nov 3 10:53 jspwiki.policy
root@64560e4e56c2:/var/jspwiki/etc# ls -l
-rw-r--r-- 1 root root 881 Nov 3 10:53 groupdatabase.xml
-rw-r--r-- 1 root root 877 Nov 3 10:53 userdatabase.xml
root@64560e4e56c2:/usr/local/tomcat/conf# ls -l
-rw-r--r-- 1 root root 7589 Nov 10 08:26 server.xml
}}}
__
At line 213 changed 4 lines
You can run multiple instances of the image of course. You only have to
make sure they use different TCP ports.\\
So for example starting 5 containers (with also a limit on memory usage
added) :
You can run multiple instances of the image of course. You only have to make sure they use different TCP ports.\\
So for example starting 5 containers (with also a limit on memory usage added) :
At line 218 changed 3 lines
$ for PORT in `seq 9080 9084`; do docker run -d -p ${PORT}:8080
--memory=128m --env="jspwiki_baseURL=http://localhost:${PORT}/" --name
jspwiki-${PORT} metskem/docker-jspwiki; done
$ for PORT in `seq 9080 9084`; do docker run -d -p ${PORT}:8080 --memory=128m --env="jspwiki_baseURL=http://localhost:${PORT}/" --name jspwiki-${PORT} metskem/docker-jspwiki; done
At line 227 changed 12 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
73d4cd8f29a0 metskem/docker-jspwiki "/bin/sh -c '/usr/lo 4
seconds ago Up 3 seconds 0.0.0.0:9084->8080/tcp jspwiki-9084
b55b716ed49f metskem/docker-jspwiki "/bin/sh -c '/usr/lo 4
seconds ago Up 3 seconds 0.0.0.0:9083->8080/tcp jspwiki-9083
6a23a3ac3df9 metskem/docker-jspwiki "/bin/sh -c '/usr/lo 4
seconds ago Up 3 seconds 0.0.0.0:9082->8080/tcp jspwiki-9082
b3b967dc4fe7 metskem/docker-jspwiki "/bin/sh -c '/usr/lo 5
seconds ago Up 4 seconds 0.0.0.0:9081->8080/tcp jspwiki-9081
68481eed8d60 metskem/docker-jspwiki "/bin/sh -c '/usr/lo 5
seconds ago Up 4 seconds 0.0.0.0:9080->8080/tcp jspwiki-9080
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73d4cd8f29a0 apache/jspwiki "/bin/sh -c '/usr/lo 4 seconds ago Up 3 seconds 0.0.0.0:9084->8080/tcp jspwiki-9084
b55b716ed49f apache/jspwiki "/bin/sh -c '/usr/lo 4 seconds ago Up 3 seconds 0.0.0.0:9083->8080/tcp jspwiki-9083
6a23a3ac3df9 apache/jspwiki "/bin/sh -c '/usr/lo 4 seconds ago Up 3 seconds 0.0.0.0:9082->8080/tcp jspwiki-9082
b3b967dc4fe7 apache/jspwiki "/bin/sh -c '/usr/lo 5 seconds ago Up 4 seconds 0.0.0.0:9081->8080/tcp jspwiki-9081
68481eed8d60 apache/jspwiki "/bin/sh -c '/usr/lo 5 seconds ago Up 4 seconds 0.0.0.0:9080->8080/tcp jspwiki-9080
At line 261 changed 2 lines
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
At line 266 changed 3 lines
You can customize your build by making source code changes (not covered
here) or change other things like the Tomcat base image version and
platform OS and JDK version.
You can customize your build by making source code changes (not covered here) or change other things like the Tomcat base image version and platform OS and JDK version.
At line 270 changed 4 lines
__Example__: Change the platform OS from Debian to the CentOS based
variation Amazon Linux 2 that uses their Corretto JDK optimized to run
in AWS.
Edit the Dockerfile as follows:\\
__Example__: Change the platform OS from Debian to the CentOS based variation Amazon Linux 2 that uses their Corretto JDK optimized to run in AWS. Edit the Dockerfile as follows:\\
At line 275 changed 2 lines
Change the Maven image used for building JSPWiki to match the one for
the OS. (Probably not need but done for consistancy)
Change the Maven image used for building JSPWiki to match the one for the OS. (Probably not need but done for consistency)
At line 278 changed 2 lines
# FROM maven:3.6-jdk-8 as package
FROM maven:3.6-amazoncorretto-11 as package
# FROM maven:3.8-jdk-8 as package
FROM maven:3.8-amazoncorretto-11 as package
At line 286 changed one line
Replace some Debian specifc lines with RedHat counterparts to add the
Replace some Debian specific lines with RedHat counterparts to add the
At line 303 changed one line
That's all.. Enjoy!
That's all... Enjoy!