-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
32 lines (26 loc) · 1.16 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This is a multistage image build. Run the following command from the
# top directory of your repo clone.
# docker build --rm -t chxdeng/mabain:latest .
FROM alpine:latest as builder
# Lets build Mabain in the alpine environment
WORKDIR /build
COPY . /build/
RUN apk update && apk add --no-cache g++ musl-dev make \
readline-dev ncurses-dev
RUN make distclean build install
# Lets run the unit-test build
RUN apk add --no-cache gtest gtest-dev openssl-dev gcovr && wget https://github.com/kinow/gtest-tap-listener/raw/master/src/tap.h -O /usr/include/gtest/tap.h
RUN make unit-test
# Now lets build the runtime
FROM alpine:latest
LABEL maintainer="Ted Bedwell tebedwel@cisco.com"
ENV MABAIN_INSTALL_DIR=/usr/local
RUN apk update && apk add --no-cache musl libstdc++ readline ncurses && mkdir /data && \
mkdir -p $MABAIN_INSTALL_DIR/include/mabain
COPY --from=builder $MABAIN_INSTALL_DIR/include/mabain/* \
$MABAIN_INSTALL_DIR/include/mabain/
COPY --from=builder $MABAIN_INSTALL_DIR/lib/*mabain*.* \
$MABAIN_INSTALL_DIR/lib/
COPY --from=builder $MABAIN_INSTALL_DIR/bin/mbc \
$MABAIN_INSTALL_DIR/bin/
VOLUME /data