HOW TO: Run Unimus in a Docker container

Beta release announcements and discussion around them
Post Reply
User avatar
X-Cubed
Posts: 3
Joined: Sat Jul 30, 2016 7:48 am
Location: New Zealand
Contact:

Sat Jul 30, 2016 8:30 am

For anyone that's interested, here are the steps involved in building a Docker image for Unimus. This is a great way to run it on the likes of the Synology DSM operating system that runs on the Synology NAS devices. Hopefully, we'll see an official Unimus Docker image in future, but this is how you can roll your own.

You'll need to have the Docker tools installed, which you can get from https://www.docker.com/products/docker. In my case, I used Docker for Windows, but it shouldn't make any difference which platform you're on.

If you're not familiar with Docker, you can read more about it at Docker.com.

Text in bold denotes commands to be run at the prompt.
  1. Open a Command Prompt, or console and create a working folder (mkdir unimus), then change into that directory (cd unimus)
  2. Create a subfolder called content (mkdir content), and download a copy of Unimus.jar into the content folder using your web browser.
  3. In the working folder, create a file called Dockerfile, with the following contents:

    Code: Select all

    FROM java:8
    ADD content /usr/src/app
    WORKDIR /usr/src/app
    ENTRYPOINT ["java", "-jar", "./Unimus.jar"]
    EXPOSE 8085
    
    You can use your favourite text editor to do this, or do it from the Windows command line by typing type NUL > Dockerfile and then notepad Dockerfile then copy and paste the text above and choose File -> Save.
  4. Run docker build -t unimus . to build an image called unimus from the current directory
  5. You can now run the image with the command docker run -P 8085:8085 unimus
  6. You should be able to access the Unimus UI by navigating to http://localhost:8085 in your web browser.
A couple of tips:
  • You can push the image to a local instance of Docker Registry if you need to run it on another machine.
  • I recommend using a separate database, rather than the file-based HSQL option, as it will allow you to update Unimus easily without losing any data.
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Sat Jul 30, 2016 9:44 am

Thanks a lot for the tutorial!

Official Docker image is on the RoadMap, I just need to integrate it into my build scripts and setup.
Will definitely be available before release :)

UPDATE:
We have pre-built images available:
https://wiki.unimus.net/display/UNPUB/Running+in+Docker
Post Reply