Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (53 sloc) 2.11 KB
# Start from Alpine and Java 8, and name this stage "build"
FROM openjdk:8u121-jre-alpine AS build
# Install C libraries and build tools
RUN echo "installing dependencies" && \
apk --update add gc-dev clang musl-dev libc-dev build-base git && \
apk add libunwind-dev --update-cache --repository
# Install re2 from source for clang++ compatability
RUN git clone && cd re2 && \
CXX=clang++ make && make install
# Install SBT
ENV SBT_HOME /usr/local/sbt
RUN echo "installing SBT $SBT_VERSION" && \
apk add --no-cache --update bash wget && mkdir -p "$SBT_HOME" && \
wget -qO - --no-check-certificate "$SBT_VERSION/sbt-$SBT_VERSION.tgz" | tar xz -C $SBT_HOME --strip-components=1 && \
echo -ne "- with sbt $SBT_VERSION\n" >> /root/.built && \
sbt sbtVersion
# Set up the directory structure for our project
RUN mkdir -p /root/project-build/project
WORKDIR /root/project-build
# Resolve all our dependencies and plugins to speed up future compilations
ADD ./project/plugins.sbt project/
ADD ./project/ project/
ADD build.sbt .
RUN sbt update
# Add and compile our actual application source code
ADD . /root/project-build/
RUN sbt clean nativeLink
# Copy the binary executable to a consistent location
RUN cp ./target/scala-2.11/*-out ./dinosaur-build-out
# Start over from a clean Alpine image
FROM alpine:3.3
# Copy in C libraries
COPY --from=build \
/usr/lib/ \
/usr/lib/ \
/usr/lib/ \
/usr/lib/ \
/usr/lib/ \
COPY --from=build \
/usr/local/lib/ \
# Copy in the executable
COPY --from=build \
/root/project-build/dinosaur-build-out /var/www/localhost/cgi-bin/app
COPY httpd.conf /etc/apache2/httpd.conf
COPY mpm.conf /etc/apache2/mpm.conf
RUN apk --update add apache2 apache2-utils
RUN mkdir -p /run/apache2
ADD /root/