...
- Now we want to create the Dockerfile which describes our Docker container
- Create a new file called "Dockerfile" within our "odysseusdocker"-folder (e.g. with nano again or what ever whatever you prefer)
- Put the content from the box below into the Dockerfile
Code Block | ||||
---|---|---|---|---|
| ||||
## We will use Ubuntuthe asofficial our basis FROM ubuntu:15.10 # We need OpenJDK Java 8 -as 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-oracleour 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 - this is the port for the WebService from Odysseus EXPOSE 9669 |
Now we have everything prepared in that folder.
...
- In your Terminal window, navigate to the "odysseusdocker"-folder
- Type "sudo docker build ." (The " ." refers to the folder we are in. The command assumes a file named "Dockerfile" in that folder.)
- Wait (it will take some time to get the basis for our container: Ubuntu Linux and OpenJDK Java 8. But next time you do it it's much faster.)
- Now we should see a message that the container was successfully build. We can type "sudo docker images" to see our images.
Code Block | ||||
---|---|---|---|---|
| ||||
Successfully built 3adf9650f4ed6eb71347fa51 tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE <none>java 8 <none> 3adf9650f4edc518da75d9f0 96 secondsdays ago 950.6 642.9 MB ubuntu<none> 15.10 <none> 6ed4652370be6eb71347fa51 276 hoursdays ago 136686.18 MB tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ |
...
- "sudo docker run -p 127.0.0.1:9700:9669 --name our_odysseus -t 3adf9650f4ed6eb71347fa51"
Code Block | ||||
---|---|---|---|---|
| ||||
tobi@tobi-VirtualBox:~/Documents/odysseusdocker$ sudo docker run -p 127.0.0.1:9700:9669 --name our_odysseus_open -t 3adf9650f4ed6eb71347fa51 Starting Odysseus ... Odysseus: Cannot open display: Odysseus: GTK+ Version Check 0 INFO CoreOdysseusConfiguration - CurrentRead sizeconfig offile heap: 1.0 GBfrom /root/.odysseus/odysseus.conf - de.uniol.inf.is.odysseus.core.server.ActivatorOdysseusConfiguration.startloadProperties(ActivatorOdysseusConfiguration.java:6186) 23 2472 INFO Core - MaximumCurrent size of heap: 1.0 GB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:6461) 26 2477 INFO Core - FreeMaximum memorysize of the heap: 8791.40 MBGB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:6764) 272479 INFO Core - Running VM with:Free memory of the heap: 801.1 amd64MB - de.uniol.inf.is.odysseus.core.Activator.start(Activator.java:7067) 9992480 INFO OdysseusConfigurationCore - Read config file from /root/.odysseus/odysseus.conf Running VM with: amd64 - de.uniol.inf.is.odysseus.core.serverActivator.OdysseusConfiguration.loadPropertiesstart(OdysseusConfigurationActivator.java:8670) 2662osgi> 6099 WARN LogicalOperatorBuilder - URL for SetTimeProgressMarker not available! - de.uniol.inf.is.odysseus.logicaloperator.LogicalOperatorBuilder.addLogicalOperator(LogicalOperatorBuilder.java:243) 32718664 INFO OdysseusServerApplication - Odysseus application is fully started! - de.uniol.inf.is.odysseus.product.server.starter.OdysseusServerApplication.start(OdysseusServerApplication.java:31) osgi> 5353 INFO SingleSchedulerManager - No Scheduler-Config-File found. - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:113) 53548669 INFO SingleSchedulerManager - New Scheduler-Config-File created - de.uniol.inf.is.odysseus.scheduler.manager.singleschedulermanager.SingleSchedulerManager.activate(SingleSchedulerManager.java:126) 54068718 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) 9087 INFO OdysseusServerApplication - Odysseus application is fully started! - de.uniol.inf.is.odysseus.product.server.starter.OdysseusServerApplication.start(OdysseusServerApplication.java:31) 752412920 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) |
...