Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replace Dockerfile content

...

Code Block
languagebash
titleCreating the magic folder
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

 

  1. Now we need the version from Odysseus that we want to run. We can use the Odysseus Server Version as an example.
  2. Download Odysseus Server for Linux here (we use the 64-bit version): http://odysseus.informatik.uni-oldenburg.de/index.php?id=76
  3. Unzip the content of your download to the odysseus-folder within our "odysseusdocker"-folder
  4. Create a new file in the "odysseusdocker"-folder with the name "startup.sh" and the content in the box below (e.g. with nano or some other text editor)
  5. Change the permission of the file to be executable: "chmod 744 startup.sh"
  6. With "ls -l" you can see if the file is executable

 

Code Block
languagebash
titlestartup.sh
#!/bin/sh
cd home
cd odysseus
echo "Starting Odysseus ..."
./odysseus

 

  1. Now we want to create the Dockerfile which describes our Docker container
  2. Create a new file called "Dockerfile" within our "odysseusdocker"-folder (e.g. with nano again or whatever you prefer)
  3. Put the content from the box below into the Dockerfile
Code Block
languagebash
titleDockerfile
FROM ubuntu
MAINTAINER <Your Name>
LABEL Description="Docker Image for running the Odysseus data stream management system" Version="0.1"  URL="http://odysseus.informatik.uni-oldenburg.de"

# 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 Install required packages
RUN apt-get -y update && apt-get -y install apt-utils wget unzip openjdk-8-jre bash nano

# Download nightly build
RUN mkdir -p /usr/lib/odysseus && mkdir -p /var/log/odysseus
RUN wget -c http://odysseus.offis.uni-oldenburg.de/download/products/server/lastBuild/odysseus.server-linux.gtk.x86_64.zip -O /tmp/odysseus.zip && unzip /tmp/odysseus.zip -d /usr/lib/odysseus && rm -f /tmp/odysseus.zip

# Define additional VM parameters
RUN echo "-XX:NativeMemoryTracking=summary" >> /usr/lib/odysseus/odysseus.ini && \
    echo "-XX:+HeapDumpOnOutOfMemoryError" >> /usr/lib/odysseus/odysseus.ini && \
    echo "-XX:HeapDumpPath=/var/log/odysseus/dumps" >> /usr/lib/odysseus/odysseus.ini && \
    echo "-XX:ErrorFile=/var/log/odysseus/dumps/hs_err_pid%p.log" >> /usr/lib/odysseus/odysseus.ini && \
    sed -i "s/org\.apache\.log4j\.ConsoleAppender/org\.apache\.log4j\.FileAppender\nlog4j\.appender\.default\.File=\/var\/log\/odysseus\/odysseus\.log/" /usr/lib/odysseus/plugins/de.uniol.inf.is.odysseus.slf4j_1.7.16/log4j.properties

# Create group and user
RUN groupadd odysseus && \
    useradd -r -g odysseus -s /bin/bash -d /var/lib/odysseus -m odysseus && \
    chown -R odysseus /var/log/odysseus

# Change timezone for UTC
RUN echo "UTC" > /etc/timezone

# Expose web server port for wsdl
EXPOSE 9669

# Change user and setup environment
USER odysseus
ENV home /var/lib/odysseus
WORKDIR /var/lib/odysseus

CMD ["/usr/lib/odysseus/odysseus"]

 

Now we have everything prepared in that folder.

...