Public Repository

Last pushed: a day ago
Short Description
Run a Cerberus instance into a Glassfish application server.
Full Description

Cerberus Glassfish images

Cerberus is an user-friendly automated testing framework.

This Docker image run a Cerberus instance into a Glassfish application server.

Tags

Check tags from the Github's image page.

Prerequisites

This image needs to be linked to a Cerberus database image, e.g., cerberus-db-mysql.

See the DATABASE_* environment variables on the Dockerfile for more information.

How to run this image

Run the image

This image can simply be run by using the following command:

docker run -d -P cerberustesting/cerberus-as-glassfish:latest

Note the use of the -d and -P arguments to let image be run as deamon and open ports outside container which is the common use.

To run image by connecting to a MySQL Cerberus database located at <database_host>:<database_port> you could run (assume we are using default values for database type, name, username, and password):

docker run -d -P -e DATABASE_HOST='<database_host>' -e DATABASE_PORT='<database_port>' cerberus/cerberus-as-glassfish:latest

Configure the running Cerberus instance

Important: Additional runtime configuration has to be made:

Set the Cerberus base URL

The Cerberus base URL has to be known by Cerberus. To do so, Cerberus has to be configured as the following:

  1. Open your favorite web browser to the Cerberus base URL (<docker_host>:18080/Cerberus by default)
  2. Go to Administration -> Parameters
  3. Search the cerberus_url parameter
  4. Set to the Cerberus base URL (<docker_host>:18080/Cerberus by default)
  5. Save changes

Note that specific configuration could be made if using Volumes mapping.

Environment variables

Hereafter list of environment variables that could be overridden when starting the image.

Environment variable Definition Default value
DATABASE_TYPE Cerberus database type mysql or mariadb only
DATABASE_HOST Cerberus database host localhost
DATABASE_PORT Cerberus database port 3306
DATABASE_NAME Cerberus database name cerberus
DATABASE_USER Cerberus database user cerberus
DATABASE_PASSWORD Cerberus database password toto
GLASSFISH_HTTP_THREADPOOL_MAX_SIZE Glassfish HTTP thread pool maximum size 500

Exposed ports

Hereafter list of exposed ports when image is running (inherited from the Glassfish image).

Exposed port Definition
8080 The Glassfish HTTP access port
4848 The Glassfish HTTP access port

Assume you want to reach to the Cerberus instance, then you would run:

docker run -d -p 18080:8080 -p 14848:4848 cerberustesting/cerberus-as-glassfish:latest

And you could access to the Cerberus instance by reaching the following URL:

<docker_host>:18080/Cerberus

Where <docker_host> is your Docker host URL.

With this example, you could access to the Glassfish administration console by reaching the following URL:

<docker_host>:14848

Volumes

Cerberus server logs

Cerberus server logs can be persisted by using the following command:

docker run [...] -v /your/local/cerberus/server/logs/directory:/usr/local/glassfish4/glassfish/domains/domain1/logs cerberus/cerberus-as-glassfish:latest

Where /your/local/cerberus/screenshots/directory is the directory to store the Cerberus execution screenshots out of your Docker host.

Cerberus screenshots

From the 1.1.5 version, the new /usr/local/glassfish4/glassfish/domains/domain1/docroot/CerberusPictures directory is created to store Cerberus execution screenshots.
Don't forget to map it to an existing folder out of your Docker host in order to make them persistent. Example:

docker run [...] -v /your/local/cerberus/screenshots/directory:/usr/local/glassfish4/glassfish/domains/domain1/docroot/CerberusPictures cerberus/cerberus-as-glassfish:latest

Where /your/local/cerberus/screenshots/directory is the directory to store the Cerberus execution screenshots out of your Docker host.

To apply this runtime configuration to Cerberus instance, then:

  1. Open your favorite web browser to the Cerberus base URL (<docker_host>:18080/Cerberus by default)
  2. Go to Administration -> Parameters
  3. Search the cerberus_picture_path parameter
  4. Set to the /usr/local/glassfish4/glassfish/domains/domain1/docroot/CerberusPictures/ value (note the important trailing /)
  5. Save changes
  6. Search the cerberus_picture_url parameter
  7. Set to the Cerberus base URL value (<docker_host>:18080/CerberusPictures/ by default, note the important trailing /)
  8. Save changes

From the 1.1.6 version, cerberus_picture_path and cerberus_picture_url parameters have been respectively renamed cerberus_mediastorage_path and cerberus_mediastorage_path.

License

Cerberus Copyright (C) 2016 Cerberus Testing

This file is part of Cerberus.
Cerberus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Cerberus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Cerberus. If not, see http://www.gnu.org/licenses/.

Docker Pull Command
Owner
cerberustesting

Comments (0)