Using OPC Router with Docker
How do I install and run OPC Router as a Docker Container?
The following steps cover the installation of OPC Router via Docker. For more info on Docker, see here: https://www.opc-router.com/what-is-docker/
You will need to already have Docker installed on the machine (https://www.docker.com/products/docker-desktop).
Installing the Image
There are two images available for use:
- OPC Runtime Image - The OPC Router runtime image has a MongoDB embedded and runs on 64-bit systems (x64 & ARM64)
- OPC Service Image - The OPC Router service requires an external MongoDB. It runs on x64, ARM64 and ARM (32-bit)
Pull down the OPC Router Image using the following command in your Command-line Input (Windows PowerShell is recommended)
Select which image you want to install
docker pull opcrouter/runtime
docker pull opcrouter/service
Creating the Container
Once the image is installed, you will need to create the Container
OPC Router Runtime Image
docker run -d -p 51515:8080 --env TZ=America/New_York -e OR_DISABLE_AUTH=true -e OR_I_ACCEPT_EULA=true -v opc-router-data:/data --name opc-router opcrouter/runtime:latest
Change the "TZ=__" labeled in bold to the correct time zone.
For regions in the US, the format for your time zone is as follows:
-
- Eastern Time: America/New_York
- Central Time: America/Chicago
- Mountain Time: America/Denver
- Pacific Time: America/Los_Angeles
OPC Router Service Image
docker run -d -e OR_DATABASE_CONNECTION_STRING=mongoDB+srv://awscluster0.mycluster.mongoDB.net/opcrouter-runtime -v opc-router-OPC-Router-cert:/root/.dotnet/corefx/cryptography/x509stores/ --name opc-router opcrouter/service:latest --i-accept-eula
Note: You must specify a connection to a MongoDB server to run this image!
Starting the Container
- From here, the container can be started and stopped using
docker start <container name> - The default container name using the commands above is opc-router
- When running, the
docker pscommand can be used to verify it is operational. - Running the
docker stop <container name>command after testing will stop the container but will not revert/rollback the changes made to the database while it was active.