Running SHARK WMS as a Docker Container#
SHARK WMS can be installed as a Docker container..
Before installation the following must be present:
- A Docker site for the installation.
- A Microsoft SQL Server (database). This can also be container.
- A valid product key for activation of the software.
Initializing the Database#
Before starting the container, a database must be created. The SHARK container can be used for creation of the database.
docker run -e DB_NAME='<database name>' -e DB_HOST_INTERNAL='<ip>' -e DB_LOGIN_NAME=sa -e DB_LOGIN_PASSWORD='<password>' -e MODE=initdb logiwaredk/shark
Running Shark#
docker run -e DB_NAME='shark_db_name' -e DB_HOST='172.16.157.145' -e MODE='all' -p 8086:8086 -d logiwaredk/shark
Environment variables for the SHARK container:
Environment Variable | Value |
---|---|
DB_NAME | Name of the database (eg. shark_prod) |
DB_HOST_INTERNAL | The host name or IP address for the MS SQL Server as seen from the Docker environment. Use the container name of the SQL Server if the SQL Server is installed with Docker. |
DB_HOST_EXTERNAL | The host name or IP address used to access the SQL Server from the PC and PDA clients. |
DB_LOGIN_NAME | Administration login to the SQL Server. Required to build a new database. |
DB_LOGIN_PASSWORD | Administration password to the SQL Server. Required to build a new database. |
INSTALLATIONNAME | Name of the installation, just textual information. |
MODE | initdb : Will create a new database. webserver : Run the web server in the Docker container. scheduler : Run the Scheduler in the Docker container. all : Run both web server and scheduler in the same container. |
WERSRVER_PORT | Internal port of the web server (8086 recommended). This is not the actually port used externally, it is mapped with the "ports" mapping to the actually port number |
LANGUAGE | This defines the language used to prime the database messages and enumerated data types. Legal values: EN, DA, SE, NO, HU, RU |
STARTUP_DELAY | Delay in ms before it starts accessing the database. To provide time for SQL Server to start |
Test the Installation#
Using Docker Compose#
To install SHARK on Linux, the recommended way to do it, is to use Docker. The following description is based on the Ubuntu Linux distribution.
Although this description is about Linux, it can also be used for other environment where Docker is supported, including Windows, Mac, etc.
SHARK may be installed in a Docker environment, look at Docker for more information.
Folder Structure#
Create first the following folders
Folder | Content |
---|---|
/opt/shark | The basic configuration is stored here. (docker-compose.yml) |
/opt/shark/tmp | Temporary files |
/opt/shark/mssql | Microsoft SQL Server data files |
Installing Docker#
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get install docker-ce
Installing Docker Compose#
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Check Docker Compose is successfully installed.
$ docker-compose --version
Installing the MS SQL Server Container#
The MS SQL Server can be installed as a Docker service or another none-docker SQL Server can be used if available.
To get the SQL Server images:
sudo docker pull microsoft/mssql-server-linux:2017-latest
Installing the SHARK Container#
Configuration#
Create a docker-compose.yml file in the /opt/shark folder.
Do not copy the example file below directly from the screen, .yml files are very sensitive to illegal characters. All white spaces must be plain spaces (no tabs).
version: '3.1'
services:
mssql:
image: microsoft/mssql-server-linux:2017-latest
container_name: mssql
ports:
- 1433:1433
environment:
ACCEPT_EULA : y
SA_PASSWORD : my_password
MSSQL_PID : Express
shark_prod:
image: logiwaredk/shark:latest
container_name: shark_prod
environment:
DB_NAME: shark_demo1
DB_HOST_INTERNAL: mssql
DB_HOST_EXTERNAL: localhost
DB_LOGIN_NAME : sa
DB_LOGIN_PASSWORD : my_password
USE_HTTPS : "false"
PRODUCTNAME : SHARK
INSTALLATIONNAME : demo1
MODE : webserver
WEBSERVER_PORT : 8086
STARTUP_DELAY : 10000
LANGUAGE : EN
ports:
- 8086:8086