-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from CDOT-CV/develop
Transition to J2735 ASN 2020, Dockerfile Optimization & Updated SCMS Files
- Loading branch information
Showing
49 changed files
with
4,776 additions
and
5,918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
[submodule "asn1c"] | ||
path = asn1c | ||
url = https://github.com/vlm/asn1c.git | ||
[submodule "pugixml"] | ||
path = pugixml | ||
url = https://github.com/zeux/pugixml.git | ||
[submodule "scms-asn1"] | ||
path = scms-asn1 | ||
url = https://github.com/usdot-jpo-ode/scms-asn1.git | ||
[submodule "asn1c"] | ||
path = asn1c | ||
url = https://github.com/mouse07410/asn1c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,70 @@ | ||
FROM ubuntu:18.04 | ||
# === BUILDER IMAGE === | ||
FROM alpine:3.12 as builder | ||
USER root | ||
|
||
WORKDIR /asn1_codec | ||
|
||
# Add build tools. | ||
RUN apt-get update && apt-get install -y software-properties-common wget git make gcc-7 g++-7 gcc-7-base && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100 | ||
|
||
# Install cmake. | ||
RUN wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && tar -xvf cmake-3.7.2.tar.gz | ||
RUN cd cmake-3.7.2 && ./bootstrap && make && make install && cd /home | ||
|
||
# install libtool and automake | ||
RUN apt-get update && apt-get install -y automake libtool | ||
|
||
# Install librdkafka. | ||
RUN apt-get install -y sudo | ||
RUN wget -qO - https://packages.confluent.io/deb/7.3/archive.key | sudo apt-key add - | ||
RUN add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/7.3 stable main" | ||
RUN add-apt-repository "deb https://packages.confluent.io/clients/deb $(lsb_release -cs) main" | ||
RUN apt update | ||
RUN apt-get install -y libsasl2-modules libsasl2-modules-gssapi-mit libsasl2-dev libssl-dev | ||
RUN apt install -y librdkafka-dev | ||
# 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 ./asn1c /asn1_codec/asn1c | ||
RUN cd /asn1_codec/asn1c && aclocal && test -f configure || autoreconf -iv && ./configure && make && make install | ||
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install | ||
|
||
# Generate ASN.1 API. | ||
# Make generated files available to the build & compile example | ||
RUN export LD_LIBRARY_PATH=/usr/local/lib | ||
ADD ./asn1c_combined /asn1_codec/asn1c_combined | ||
ADD ./scms-asn1 /asn1_codec/scms-asn1 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.c | ||
*.h | ||
*.o | ||
Makefile* | ||
./*.c | ||
./*.h | ||
./*.o | ||
./Makefile* | ||
|
Oops, something went wrong.