In this guide we will show you how to create a Docker container for Odysseus. Such a container can help you to run and share Odysseus more easily. If you want to use our predefined Odysseus Server Docker Container, see Run with Docker.
We assume that you have a Linux system up and running, e.g. Ubuntu. If you want to try it out without changing your system or if you don't have a Linux machine, we recommend VirtualBox.
Now we need a folder where we can put everything that we need in.
tobi@tobi-VirtualBox:~$ ls Desktop Documents Downloads examples.desktop Music Pictures Public Templates Videos tobi@tobi-VirtualBox:~$ cd Documents/ tobi@tobi-VirtualBox:~/Documents$ ls tobi@tobi-VirtualBox:~/Documents$ mkdir odysseusdocker tobi@tobi-VirtualBox:~/Documents$ ls odysseusdocker tobi@tobi-VirtualBox:~/Documents$ cd odysseusdocker/ tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ mkdir odysseus |
#!/bin/sh cd home cd odysseus echo "Starting Odysseus ..." ./odysseus |
# We will use the official OpenJDK Java 8 as our platform FROM java:8 # Start Odysseus on startup of the container ADD startup.sh /home/startup.sh ADD odysseus /home/odysseus CMD ./home/startup.sh # We need a port to be exposed EXPOSE 9669 |
Now we have everything prepared in that folder.
Successfully built c39f4bd5fd33 tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE <none> <none> c39f4bd5fd33 2 minutes ago 686.8 MB java 8 c518da75d9f0 6 days ago 642.9 MB |
Now we can run the Docker container:
tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker run -p 127.0.0.1:9700:9669 --name our_odysseus -t c39f4bd5fd33 Starting Odysseus ... Odysseus: Cannot open display: Odysseus: GTK+ Version Check 0 INFO Core - Current size of heap: 1.0 GB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:61) 35 INFO Core - Maximum size of heap: 1.0 GB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:64) 41 INFO Core - Free memory of the heap: 879.4 MB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:67) 52 INFO Core - Running VM with: amd64 - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:70) 1912 INFO OdysseusConfiguration - Read config file from /root/.odysseus/odysseus.conf - de.uniol.inf.is.odysseus.core.server.OdysseusConfiguration.loadProperties(OdysseusConfiguration.java:86) 4561 WARN LogicalOperatorBuilder - URL for SetTimeProgressMarker not available! - de.uniol.inf.is.odysseus.logicaloperator.LogicalOperatorBuilder.addLogicalOperator(LogicalOperatorBuilder.java:243) 5699 INFO OdysseusServerApplication - Odysseus application is fully started! - de.uniol.inf.is.odysseus.product.server.starter.OdysseusServerApplication.start(OdysseusServerApplication.java:31) osgi> 9005 INFO SingleSchedulerManager - No Scheduler-Config-File found. - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:113) 9030 INFO SingleSchedulerManager - New Scheduler-Config-File created - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:126) 9109 INFO SingleSchedulerManager - Active scheduler. class de.uniol.inf.is.odysseus.scheduler.singlethreadscheduler.SimpleThreadSchedulerMSLimitSourcesPerThread - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:137) 13453 INFO WebServicePublisher - Webservice published at http://0:0:0:0:0:0:0:0:9669/odysseus - de.uniol.inf.is.odysseus.planmanagement.executor.webservice.server.WebServicePublisher.publish(WebServicePublisher.java:106) |
As you can see above, Odysseus started. We also exposed one port the the outside: port 9669 is forwarded to port 9700, wherefore we should be able to see the WebService in our host machine. Just open http://localhost:9700/odysseus?wsdl in a browser on your host machine.You should be able to see an XML-file describing the Odysseus WebService.
We want to make is easy for others to install Odysseus. Hence, we will push our image to DockerHub.
Now we want to try our if our docker container works as expected. First, we need to remove everything we did until now. If we don't do this, docker won't pull the image because it is the same as the one we pushed in the step before.
sudo docker stop our_odysseus
sudo docker rm our_odysseus
sudo docker rmi $(sudo docker images -q)
Now, everything we did should be removed. Let's run Odysseus from DockerHub.
Now, Odysseus should run exactly as it was running in our previous local test. You should be able to see the WebService description in your browser: http://localhost:9700/odysseus?wsdl
sudo docker rmi $(sudo docker images -q)