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 user 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 Ubuntu as our basis FROM ubuntu:15.10 # We need Java 8 - install Java 8 on that Ubuntu machine RUN apt-get update RUN apt-get install software-properties-common -y RUN add-apt-repository ppa:webupd8team/java -y RUN apt-get update RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections RUN apt-get install oracle-java8-installer -y RUN apt-get install oracle-java8-set-default # Add java to environment variables ENV JAVA_HOME /usr/lib/jvm/java-8-oracle # 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 - this is the port for the WebService from Odysseus EXPOSE 9669 |
Now we have everything prepared in that folder.
Successfully built 3adf9650f4ed tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE <none> <none> 3adf9650f4ed 9 seconds ago 950.6 MB ubuntu 15.10 6ed4652370be 27 hours ago 136.1 MB tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ |
Now we can run the Docker container:
tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker -p 9669:9700 run 3adf9650f4ed Starting Odysseus ... 0 INFO Core - Current size of heap: 1.0 GB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:61) 24 INFO Core - Maximum size of heap: 1.0 GB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:64) 25 INFO Core - Free memory of the heap: 879.4 MB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:67) 50 INFO Core - Running VM with: amd64 - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:70) 1280 INFO OdysseusConfiguration - Read config file from /root/.odysseus/odysseus.conf - de.uniol.inf.is.odysseus.core.server.OdysseusConfiguration.loadProperties(OdysseusConfiguration.java:86) 3099 WARN LogicalOperatorBuilder - URL for SetTimeProgressMarker not available! - de.uniol.inf.is.odysseus.logicaloperator.LogicalOperatorBuilder.addLogicalOperator(LogicalOperatorBuilder.java:243) 3734 INFO OdysseusServerApplication - Odysseus application is fully started! - de.uniol.inf.is.odysseus.product.server.starter.OdysseusServerApplication.start(OdysseusServerApplication.java:31) osgi> 5796 INFO SingleSchedulerManager - No Scheduler-Config-File found. - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:113) 5799 INFO SingleSchedulerManager - New Scheduler-Config-File created - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:126) 5836 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) 8181 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) |