-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile.standalone
70 lines (58 loc) · 1.83 KB
/
Dockerfile.standalone
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
61
62
63
64
65
66
67
68
69
70
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root
WORKDIR /asn1_codec
# add build dependencies
RUN apk add --upgrade --no-cache --virtual .build-deps \
cmake \
g++ \
make \
bash \
automake \
libtool \
autoconf \
librdkafka \
librdkafka-dev \
flex \
bison
# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install
# Build and install asn1c submodule
ADD ./usdot-asn1c /asn1_codec/asn1c
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install
# Make generated files available to the build & compile example
RUN export LD_LIBRARY_PATH=/usr/local/lib
ADD ./asn1c_combined /asn1_codec/asn1c_combined
RUN cd /asn1_codec/asn1c_combined && bash doIt.sh
# Remove any lingering .asn files
RUN rm -rf /asn1c_codec/asn1c_combined/j2735-asn-files
RUN rm -rf /asn1c_codec/asn1c_combined/semi-asn-files
# Remove duplicate files
RUN rm -rf /asn1c_codec/asn1c_combined/generated-files
# add the source and build files
ADD CMakeLists.txt /asn1_codec
ADD ./config /asn1_codec/config
ADD ./include /asn1_codec/include
ADD ./src /asn1_codec/src
ADD ./kafka-test /asn1_codec/kafka-test
ADD ./unit-test-data /asn1_codec/unit-test-data
ADD ./data /asn1_codec/data
ADD ./run_acm.sh /asn1_codec
ADD ./data /asn1_codec/data
# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make
# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec
# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test