Last active
November 25, 2017 07:28
-
-
Save awade/1580dedd54e233a6ab4099302d97bfde to your computer and use it in GitHub Desktop.
This is a docker file for generating an Alpine linux based image for hosting an elog (https://midas.psi.ch/elog/). You must mount a directory volume into /home with the elogd.cfd file and logbooks folder. Otherwise you must change the final CMD line to point to your elogd config file, preferably on a mounted volume to be persistent between docke…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Note: This is explicitly broken into stages for debug. To minimize size the run commands must be combined together so that docker doesn't cache files from each stage in layers. | |
FROM alpine:latest | |
MAINTAINER Andrew Wade <[email protected]> | |
# Set the working directory to /app | |
WORKDIR /builddir | |
# Copy the current directory contents into the container at /app | |
ADD . /builddir | |
# Make port 8080 available to the world outside this container | |
EXPOSE 8080 | |
# All the packages | |
RUN apk update -q && \ | |
apk add --no-cache openssl-dev && \ | |
apk add --no-cache --virtual .build-deps \ | |
build-base \ | |
git | |
# Get the elog source for building | |
RUN git clone https://bitbucket.org/ritt/elog --recursive | |
# Build the elog and move parts to relevant system directories | |
RUN cd /builddir/elog && \ | |
make && \ | |
make install | |
# Adding users and config files so it can be run from non-root mode | |
RUN adduser -S -g elog elog && addgroup -S elog | |
# Needed only if mounted version in home folder fails and needs to go into default mode for testing | |
COPY ./elogd.cfg /usr/local/elog/elogd.cfg | |
# Modify permissions | |
RUN cd /usr/local/elog/ && \ | |
chown elog:elog elogd.cfg && \ | |
chown -R elog:elog logbooks | |
# Remove build files and tools that are superfluous after build is complete | |
RUN apk del .build-deps | |
RUN rm -r /builddir/elog/ | |
CMD ["/usr/local/sbin/elogd", "-p", "8080", "-c", "/home/elogd.cfg"] | |
~ | |
~ | |
~ | |
~ | |
~ | |
"Dockerfile" 40L, 973C written |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global] | |
port = 8080 | |
Usr = elog | |
Grp = elog | |
[Test_Notes] | |
Theme = default | |
Comment = Docker test file | |
Attributes = Author, Type, Category, Subject | |
Options Type = Type1, Type2 | |
Options Category = One, Two, Four | |
Extendable Options = Category | |
Required Attributes = Author, Type | |
Page Title = ELOG - $subject | |
Reverse sort = 1 | |
Quick filter = Date, Type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment