forked from usdot-jpo-ode/jpo-cvdp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-nsv
60 lines (46 loc) · 1.41 KB
/
Dockerfile-nsv
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# === RUNTIME DEPENDENCIES IMAGE ===
FROM alpine:3.12 as runtime-deps
USER root
WORKDIR /cvdi-stream
# update the package manager
RUN apk update
# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
# === BUILDER IMAGE ===
FROM runtime-deps as builder
USER root
ARG PPM_CONFIG_FILE
ARG PPM_MAP_FILE
WORKDIR /cvdi-stream
ENV DEBIAN_FRONTEND=noninteractive
# add build dependencies
RUN apk add --upgrade --no-cache --virtual .build-deps \
cmake \
g++ \
make
# add the source and build files
ADD CMakeLists.txt /cvdi-stream
ADD ./src /cvdi-stream/src
ADD ./cv-lib /cvdi-stream/cv-lib
ADD ./include /cvdi-stream/include
ADD ./kafka-test /cvdi-stream/kafka-test
ADD ./unit-test-data /cvdi-stream/unit-test-data
ADD config/${PPM_CONFIG_FILE} /cvdi-stream/config/
ADD data/${PPM_MAP_FILE} /cvdi-stream/config/
ADD ./config /cvdi-stream/config
# do the build
RUN export LD_LIBRARY_PATH=/usr/local/lib && mkdir /cvdi-stream-build && cd /cvdi-stream-build && cmake /cvdi-stream && make
# === RUNTIME IMAGE ===
FROM runtime-deps
USER root
WORKDIR /cvdi-stream
# copy the built files from the builder
COPY --from=builder /cvdi-stream-build/ /cvdi-stream-build/
COPY --from=builder /cvdi-stream /cvdi-stream
# add test data (this changes frequently so keep it low in the file)
ADD ./docker-test /cvdi-stream/docker-test
# run the tool
CMD ["/cvdi-stream/docker-test/ppm-nsv.sh"]