Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into j2735/transition-t…
Browse files Browse the repository at this point in the history
…o-2020
  • Loading branch information
dmccoystephenson committed Jan 10, 2024
2 parents 27f87d8 + db7c5c6 commit 8fc13d8
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 65 deletions.
52 changes: 31 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
FROM ubuntu:18.04
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root

WORKDIR /asn1_codec

VOLUME ["/asn1_codec_share"]

# 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 apt-get install -y cmake
# update the package manager
RUN apk update

# install libtool and automake
RUN 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

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
Expand Down Expand Up @@ -52,6 +48,7 @@ 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

RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.profile
RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
Expand All @@ -61,8 +58,21 @@ RUN echo "export CC=gcc" >> ~/.bashrc
# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]

# 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

# run ACM
RUN chmod 7777 /asn1_codec/run_acm.sh
Expand Down
59 changes: 35 additions & 24 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
FROM ubuntu:18.04
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root

WORKDIR /asn1_codec

VOLUME ["/asn1_codec_share"]

# 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 editors vim and nano
RUN apt-get update && apt-get install -y vim
RUN apt-get update && apt-get install -y nano

# 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
# update the package manager
RUN apk update

# 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

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
Expand Down Expand Up @@ -57,6 +48,7 @@ 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

RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.profile
RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
Expand All @@ -66,6 +58,25 @@ RUN echo "export CC=gcc" >> ~/.bashrc
# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make

# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]

# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev

# install editors vim and nano
RUN apk update && apk add vim nano

# 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

Expand Down
50 changes: 31 additions & 19 deletions Dockerfile.standalone
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
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
# update the package manager
RUN apk update

# 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

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
Expand Down Expand Up @@ -51,9 +47,25 @@ 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
2 changes: 1 addition & 1 deletion docker_build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
#!/bin/sh
docker build -t asn1_codec:latest .

0 comments on commit 8fc13d8

Please sign in to comment.