Commit 5cc255e2 authored by Bernward's avatar Bernward
Browse files

Decker in Docker

parent 96a8af77
#Ubuntu just provides the the best toolbox for decker, the offical Haskell immage doesn't have all dependencies
#The 17.10 as a rolling release is used because of the sass-compiler
# source of the missing dependecy:
# if the 18:04 LTS is available this one is automatically used, maybe then it can be set it as a fixed base-mage
FROM ubuntu:rolling
#update the packages
RUN apt-get update
#install all haskell-stack dependencies, for some reasons an extra gcc is required
RUN apt-get install -y xz-utils && \
apt-get install -y gcc && \
apt-get install -y wget && \
apt-get install -y git
#install haskell-stack
RUN wget -qO- | sh
#install all decker dependencies
RUN apt-get install -y unzip zip && \
apt-get install -y rsync && \
apt-get install -y graphviz && \
apt-get install -y gnuplot && \
apt-get install -y sassc
#for pdf-features:
RUN apt-get install -y pdf2svg && \
apt-get install -y texlive-latex-base
#cloning the decker repo with HTTPS to avoid SSH-Key hazzle, otherwise the SSH-key has to be added to the container with 'ADD'
RUN git clone
#change to the decker source-folder
WORKDIR /decker
#the git checkout is a stable release under ubuntu, maybe this could be solved nicer
#a checkout by a tag would of course be better
RUN git checkout cb68693de73576cff738a531a65229191351030b
#install decker from the source
RUN make install
#add the location of decker binary to the PATH
ENV PATH="/root/.local/bin:${PATH}"
#set the encoding on UTF-8, so the parser works correctly, german language is also added for umlaute
#source of fix:
RUN apt-get install --reinstall -y locales && \
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen de_DE.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
#Create a loction for the volume with the decker-files
RUN mkdir servedFiles
#cleanup to get a smaller image
RUN apt-get clean autoclean && \
apt-get autoremove -y
#serving Files
CMD [ "sh", "-c", "cd /servedFiles/; decker server" ]
#open the port for mapping
Expose 8888
# Usage:
Note: On some systems docker may requires super user previliges.
1. Install [Docker]( on your host-OS.
2. Download the `ServerWithCustomSlides`.
3. Change the directory to this one: `cd <path/to/dir/ServerWithCustomSlides>`
4. Put your sildes in the `servedFiles` directory.
5. Run: `docker build -t decker .` to build the image.
6. Run: `docker run -d -p 80:8888 -v "$PWD"/servedFiles:/servedFiles --name my-decker decker` to run the image in a container.
Now you have the slides on your [localhost](http://localhost).
## How it works:
Decker with all dependencies runs in a Docker-container.
The `servedFiles` is mounted as a volume in the Docker-container.
# This a test
- It seems that the Server is working :)
# Your silde could be here
- Copy your Decker-files to the ´servedFiles´
- Restart the Container
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment