Skip to content

Commit

Permalink
Use "```console" in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed May 10, 2017
1 parent 7a834d6 commit 718211c
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 101 deletions.
48 changes: 29 additions & 19 deletions adminer/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ Adminer (formerly phpMinAdmin) is a full-featured database management tool writt

### Standalone

$ docker run --link some_database:db -p 8080:8080 adminer
```console
$ docker run --link some_database:db -p 8080:8080 adminer
```

Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser.

### FastCGI

If you are already running a FastCGI capable web server you might prefer running adminer via FastCGI:

$ docker run --link some_database:db -p 9000:9000 adminer:fastcgi
```console
$ docker run --link some_database:db -p 9000:9000 adminer:fastcgi
```

Then point your web server to port 9000 of the container.

Expand All @@ -32,25 +36,29 @@ This image bundles all official adminer plugins. You can find the list of plugin

To load plugins you can pass a list of filenames in `ADMINER_PLUGINS`:

$ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='tables-filter tinymce' adminer
```console
$ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='tables-filter tinymce' adminer
```

If a plugin *requires* parameters to work correctly you will need to add a custom file to the container:

$ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='login-servers' adminer
Unable to load plugin file "login-servers", because it has required parameters: servers
Create a file "/var/www/html/plugins-enabled/login-servers.php" with the following contents to load the plugin:

<?php
require_once('plugins/login-servers.php');

/** Set supported servers
* @param array array($domain) or array($domain => $description) or array($category => array())
* @param string
*/
return new AdminerLoginServers(
$servers = ???,
$driver = 'server'
);
```console
$ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='login-servers' adminer
Unable to load plugin file "login-servers", because it has required parameters: servers
Create a file "/var/www/html/plugins-enabled/login-servers.php" with the following contents to load the plugin:

<?php
require_once('plugins/login-servers.php');

/** Set supported servers
* @param array array($domain) or array($domain => $description) or array($category => array())
* @param string
*/
return new AdminerLoginServers(
$servers = ???,
$driver = 'server'
);
```

To load a custom plugin you can add PHP scripts that return the instance of the plugin object to `/var/www/html/plugins-enabled/`.

Expand All @@ -60,7 +68,9 @@ The image bundles all the designs that are available in the source package of ad

To use a bundled design you can pass its name in `ADMINER_DESIGN`:

$ docker run --link some_database:db -p 8080:8080 -e ADMINER_DESIGN='nette' adminer
```console
$ docker run --link some_database:db -p 8080:8080 -e ADMINER_DESIGN='nette' adminer
```

To use a custom design you can add a file called `/var/www/html/adminer.css`.

Expand Down
42 changes: 29 additions & 13 deletions convertigo/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Convertigo Community edition brought to you by Convertigo SA (Paris & San Franci

## Quick start

$ docker run --name C8O -d -p 28080:28080 convertigo
```console
$ docker run --name C8O -d -p 28080:28080 convertigo
```

This will start a container running the minimum Convertigo MBaaS server. Convertigo MBaaS uses images' **/workspace** directory to store configuration file and deployed projects as an Docker volume.

Expand All @@ -29,30 +31,38 @@ Convertigo MBaaS FullSync module uses Apache CouchDB 1.6.1 as NoSQL repository.

Launch CouchDB container and name it 'fullsync'

docker run -d --name fullsync couchdb:1.6.1
```console
$ docker run -d --name fullsync couchdb:1.6.1
```

Then launch Convertigo and link it to the running 'fullsync' container. Convertigo MBaaS sever will automatically use it as its fullsync repository.

docker run -d --name C8O-MBAAS --link fullsync:couchdb -p 28080:28080 convertigo
```console
$ docker run -d --name C8O-MBAAS --link fullsync:couchdb -p 28080:28080 convertigo
```

## Link Convertigo to a Billing & Analytics database

### MySQL

MySQL is the recommended database for holding Convertigo MBaaS server analytics. You can use this command to run convertigo and link it to a running MySQL container. Change `[mysql-container]` to the container name, and `[username for the c8oAnalytics db]`, `[password for specified db user]` with the values for your MySQL configuration.

docker run -d --name C8O-MBAAS --link [mysql-container]:mysql -p 28080:28080 \
-e JAVA_OPTS="-Dconvertigo.engine.billing.enabled=true \
-Dconvertigo.engine.billing.persistence.jdbc.username=[username for the c8oAnalytics db] \
-Dconvertigo.engine.billing.persistence.jdbc.password=[password for specified db user] \
-Dconvertigo.engine.billing.persistence.jdbc.url=jdbc:mysql://mysql:3306/c8oAnalytics" \
convertigo
```console
$ docker run -d --name C8O-MBAAS --link [mysql-container]:mysql -p 28080:28080 \
-e JAVA_OPTS="-Dconvertigo.engine.billing.enabled=true \
-Dconvertigo.engine.billing.persistence.jdbc.username=[username for the c8oAnalytics db] \
-Dconvertigo.engine.billing.persistence.jdbc.password=[password for specified db user] \
-Dconvertigo.engine.billing.persistence.jdbc.url=jdbc:mysql://mysql:3306/c8oAnalytics" \
convertigo
```

## Where is Convertigo MBaaS server storing deployed projects

Projects are deployed in the Convertigo workspace, a simple file system directory. You can map the docker container **/workspace** to your physical system by using :

docker run --name C8O-MBAAS -v $(pwd):/workspace -d -p 28080:28080 convertigo
```console
$ docker run --name C8O-MBAAS -v $(pwd):/workspace -d -p 28080:28080 convertigo
```

You can share the same workspace by all Convertigo containers. This this case, when you deploy a project on a Convertigo container, it will be seen by others. This is the best way to build multi-instance load balanced Convertigo server farms.

Expand All @@ -72,21 +82,27 @@ These accounts can be configured through the *administration console* and saved

You can change the default administration account :

docker run -d --name C8O-MBAAS -e CONVERTIGO_ADMIN_USER=administrator -e CONVERTIGO_ADMIN_PASSWORD=s3cret -p 28080:28080 convertigo
```console
$ docker run -d --name C8O-MBAAS -e CONVERTIGO_ADMIN_USER=administrator -e CONVERTIGO_ADMIN_PASSWORD=s3cret -p 28080:28080 convertigo
```

### `CONVERTIGO_TESTPLATFORM_USER` and `CONVERTIGO_TESTPLATFORM_PASSWORD` variables

You can lock the **testplatform** by setting the account :

docker run -d --name C8O-MBAAS -e CONVERTIGO_TESTPLATFORM_USER=tp_user -e CONVERTIGO_TESTPLATFORM_PASSWORD=s3cret -p 28080:28080 convertigo
```console
$ docker run -d --name C8O-MBAAS -e CONVERTIGO_TESTPLATFORM_USER=tp_user -e CONVERTIGO_TESTPLATFORM_PASSWORD=s3cret -p 28080:28080 convertigo
```

## `JAVA_OPTS` Environment variable

Convertigo is based on a *Java* process with some defaults *JVM* options. You can override our defaults *JVM* options with you own.

Add any *Java JVM* options such as -Xmx or -D[something]

docker run -d --name C8O-MBAAS -e JAVA_OPTS="-Xmx4096 -DjvmRoute=server1" -p 28080:28080 convertigo
```console
$ docker run -d --name C8O-MBAAS -e JAVA_OPTS="-Xmx4096 -DjvmRoute=server1" -p 28080:28080 convertigo
```

## Pre configurated Docker compose stack

Expand Down
8 changes: 6 additions & 2 deletions eclipse-mosquitto/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Three directories have been created in the image to be used for configuration, p

When running the image, the default configuration values are used. To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf`

docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
```console
$ docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
```

Configuration can be changed to:

Expand All @@ -37,6 +39,8 @@ i.e. add the following to `mosquitto.conf`:

Run a container using the new image:

docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto
```console
$ docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto
```

**Note**: if the mosquitto configuration (mosquitto.conf) was modified to use non-default ports, the docker run command will need to be updated to expose the ports that have been configured.
126 changes: 73 additions & 53 deletions silverpeas/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ These environment variables can be also defined as properties into the Silverpea

In [Docker Hub](https://hub.docker.com/), no Docker images of Microsoft SQLServer are currently available, but you will find a lot of images of PostgreSQL. For example, with an [official PostgreSQL docker image](https://hub.docker.com/_/postgres/), you can start a PostgreSQL instance initialized with a superuser `postgres` with as password `mysecretpassword`:

$ docker run --name postgresql -d \
-e POSTGRES_PASSWORD="mysecretpassword" \
-v postgresql-data:/var/lib/postgresql/data \
postgres:9.6
```console
$ docker run --name postgresql -d \
-e POSTGRES_PASSWORD="mysecretpassword" \
-v postgresql-data:/var/lib/postgresql/data \
postgres:9.6
```

We recommend strongly to mount the directory with the database file on the host so the data won't be lost when upgrading PostgreSQL to a newer version (a Data Volume Container can be used instead). For any information how to start a PostgreSQL container, you can refer its [documentation]((https://hub.docker.com/_/postgres/).

Expand All @@ -47,14 +49,16 @@ Once the database system is running, a database for Silverpeas has to be created

Finally, a Silverpeas instance can be started by specifying the required database access parameters with the environment variables. In the example, the database is named `Silverpeas` and the priviledged user is `silverpeas` with as password `thesilverpeaspassword`:

$ docker run --name silverpeas -p 8080:8000 -d \
-e DB_NAME="Silverpeas" \
-e DB_USER="silverpeas" \
-e DB_PASSWORD="thesilverpeaspassword" \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
--link postgresql:database \
silverpeas
```console
$ docker run --name silverpeas -p 8080:8000 -d \
-e DB_NAME="Silverpeas" \
-e DB_USER="silverpeas" \
-e DB_PASSWORD="thesilverpeaspassword" \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
--link postgresql:database \
silverpeas
```

Here, as the PostgreSQL database is linked under the alias `database`, we don't have to explicitly indicate its hostname with the `DB_SERVER` environment variable. The Silverpeas images expose the 8000 port and here this port is mapped to the 8080 port of the host; Silverpeas is then accessible at `http://localhost:8080/silverpeas`. You can sign in Silverpeas with the administrator account `SilverAdmin` and with as password `SilverAdmin`.

Expand All @@ -64,25 +68,29 @@ By default, some volumes are created inside the container, so that we can access

The Silverpeas global configuration is defined in the `/opt/silverpeas/configuration/config.properties` file whose a sample can be found [here](https://raw.githubusercontent.com/Silverpeas/Silverpeas-Distribution/master/src/main/dist/configuration/sample_config.properties) or in the container directory `/opt/silverpeas/configuration/`. You can explicitly create the `config.properties` file with, additionally to the database access parameters, your peculiar configuration parameters and then start a Silverpeas instance with this configuration file:

$ docker run --name silverpeas -p 8080:8000 -d \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/config.properties
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
--link postgresql:database \
silverpeas
```console
$ docker run --name silverpeas -p 8080:8000 -d \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/config.properties
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
--link postgresql:database \
silverpeas
```

where `/etc/silverpeas/config.properties` is your own configuration file on the host. For security reason, we strongly recommend to set explicitly the administrator's credentials with the properties `SILVERPEAS_ADMIN_LOGIN` and `SILVERPEAS_ADMIN_PASSWORD` in the `config.properties` file. (Don't forget to set also the administrator email address with the property `SILVERPEAS_ADMIN_EMAIL`.)

## Start a Silverpeas instance with a database on the host

For a database system running on the host (or on a remote host) with 192.168.1.14 as IP address, you have to specify this host both to the container at starting and to Silverpeas by defining it into its global configuration file:

$ docker run --name silverpeas -p 8080:8000 -d \
--add-host=database:192.168.1.14 \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/config.properties \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
silverpeas
```console
$ docker run --name silverpeas -p 8080:8000 -d \
--add-host=database:192.168.1.14 \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/config.properties \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-data:/opt/silverpeas/data \
silverpeas
```

where `database` is the hostname referred by the `DB_SERVER` parameter in your `/etc/silverpeas/config.properties` file as the host running the database system and that is mapped here to the actual IP address of this host. The hostname is added in the `/etc/hosts` file in the container.

Expand Down Expand Up @@ -116,42 +124,50 @@ All these different kind of data have to be consistent for a given state of Silv

To define a Data Volume Container for Silverpeas, for example:

$ docker create --name silverpeas-store \
-v silverpeas-data:/opt/silverpeas/data \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-workflows:/opt/silverpeas/xmlcomponents/workflows \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/properties \
silverpeas \
/bin/true
```console
$ docker create --name silverpeas-store \
-v silverpeas-data:/opt/silverpeas/data \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-workflows:/opt/silverpeas/xmlcomponents/workflows \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/properties \
silverpeas \
/bin/true
```

Then to mount the volumes in the Silverpeas container:

$ docker run --name silverpeas -p 8080:8000 -d \
--link postgresql:database \
--volumes-from silverpeas-store \
silverpeas
```console
$ docker run --name silverpeas -p 8080:8000 -d \
--link postgresql:database \
--volumes-from silverpeas-store \
silverpeas
```

If you have to customize the settings of Silverpeas or add, for example, a new database definition, then specify these settings with the Data Volume Container, so that they will be available to the next versions of Silverpeas which will be then configured correctly like your previous Silverpeas installation:

$ docker create --name silverpeas-store \
-v silverpeas-data:/opt/silverpeas/data \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-properties:/opt/silverpeas/properties \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/properties \
-v /etc/silverpeas/CustomerSettings.xml:/opt/silverpeas/configuration/silverpeas/CustomerSettings.xml \
-v /etc/silverpeas/my-datasource.cli:/opt/silverpeas/configuration/jboss/my-datasource.cli \
silverpeas \
/bin/true
```console
$ docker create --name silverpeas-store \
-v silverpeas-data:/opt/silverpeas/data \
-v silverpeas-log:/opt/silverpeas/log \
-v silverpeas-properties:/opt/silverpeas/properties \
-v /etc/silverpeas/config.properties:/opt/silverpeas/configuration/properties \
-v /etc/silverpeas/CustomerSettings.xml:/opt/silverpeas/configuration/silverpeas/CustomerSettings.xml \
-v /etc/silverpeas/my-datasource.cli:/opt/silverpeas/configuration/jboss/my-datasource.cli \
silverpeas \
/bin/true
```

# Document conversion

Some features in Silverpeas (export, preview, content visualization, ...) requires a document converter. The document converter isn't mandatory to use Silverpeas but it gives access to additional features. The document conversion is performed in Silverpeas by the program LibreOffice running as a daemon. So, in order to enable and to use these features, you have first to use a Data Volume Container to store all the Silverpeas data and second to run a container embbeding a LibreOffice program running as a daemon. There is no official Docker images of LibreOffice but DockerHub hosts some of unofficial images of it ([xcgd/libreoffice](https://hub.docker.com/r/xcgd/libreoffice/) for example).

Once a Data Volume Container is created for Silverpeas as explained in the section above, you have to link it with the Docker image running LibreOffice as a daemon in order the program have access the documents to convert:

$ docker run --name libreoffice -d \
--volumes-from silverpeas-store \
xcgd/libreoffice
```console
$ docker run --name libreoffice -d \
--volumes-from silverpeas-store \
xcgd/libreoffice
```

Check the port at which the LibreOffice image is listening and then defines it in the Silverpeas configuration. In our example, `xcgd/libreoffice` listens by default the port 8997. The configuration parameters to communicate with LibreOffice are defined by the two following properties:

Expand All @@ -165,16 +181,20 @@ These properties have to be defined in the Silverpeas global configuration file

Then the Docker image of Silverpeas can be ran:

$ docker run --name silverpeas -p 8080:8000 -d \
--link postgresql:database \
--link libreoffice:libreoffice \
--volumes-from silverpeas-store \
silverpeas
```console
$ docker run --name silverpeas -p 8080:8000 -d \
--link postgresql:database \
--link libreoffice:libreoffice \
--volumes-from silverpeas-store \
silverpeas
```

# Logs

You can follow the activity of Silverpeas by watching the logs generated in the mounted `/opt/silverpeas/log` directory.

The output of Wildfly is redirected into the container standard output and so it can be watched as following:

$ docker logs -f silverpeas
```console
$ docker logs -f silverpeas
```
Loading

0 comments on commit 718211c

Please sign in to comment.