1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00
ohwgiles_laminar/docker/Dockerfile
Oliver Giles 1bb545e3f9 cmake: more appropriate use of CMAKE_INSTALL_PREFIX
CMAKE_INSTALL_PREFIX is supposed to be used to set an install prefix
of e.g. /usr or /usr/local. Because we need to install files to /etc,
we had been requiring CMAKE_INSTALL_PREFIX=/ and installing using
relative paths.

The best practice method is to install to /etc using absolute paths,
and then allow CMAKE_INSTALL_PREFIX to set where the final binaries
actually go. Now that it actually has some meaning, the systemd
service is generated to incorporate that path.

Those wishing to use "make install" to install laminar to a subdir
should use "make DESTDIR=path/to/subdir install" and NOT modify
CMAKE_INSTALL_PREFIX.

Documentation and packaging scripts updated accordingly.
2020-06-20 15:59:35 +12:00

46 lines
1.3 KiB
Docker

FROM alpine:edge
EXPOSE 8080
LABEL org.label-schema.name="laminar" \
org.label-schema.description="Fast and lightweight Continuous Integration" \
org.label-schema.usage="/usr/doc/UserManual.md" \
org.label-schema.url="https://laminar.ohwg.net" \
org.label-schema.vcs-url="https://github.com/ohwgiles/laminar" \
org.label-schema.schema-version="1.0" \
org.label-schema.docker.cmd="docker run -d -p 8080:8080 laminar"
RUN apk add --no-cache -X http://dl-3.alpinelinux.org/alpine/edge/testing/ \
sqlite-dev \
zlib \
capnproto \
tini
ADD UserManual.md /usr/doc/
ADD . /build/laminar
RUN apk add --no-cache --virtual .build -X http://dl-3.alpinelinux.org/alpine/edge/testing/ \
build-base \
cmake \
capnproto-dev \
boost-dev \
zlib-dev \
rapidjson-dev && \
cd /build/laminar && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && \
make -j4 && \
make install && \
apk del .build && \
rm -rf /build
# Create laminar system user in "users" group
RUN adduser -SDh /var/lib/laminar -g 'Laminar' -G users laminar
# Set the working directory to the laminar user's home
WORKDIR /var/lib/laminar
# Run the preceeding as the user laminar
USER laminar
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "laminard" ]