build newrelic libs

This commit is contained in:
Brandon Thomas
2020-08-04 23:36:01 -04:00
parent 6bd56aad75
commit 47f4f75eb5
+12 -1
View File
@@ -3,22 +3,33 @@
FROM ubuntu:xenial as build FROM ubuntu:xenial as build
WORKDIR /tmp WORKDIR /tmp
# libpcre3-dev is for newrelic
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y \ && apt-get install -y \
build-essential \ build-essential \
curl \ curl \
libpcre3-dev \
libssl-dev \ libssl-dev \
libssl1.0.0 \ libssl1.0.0 \
pkg-config pkg-config
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- --default-toolchain stable -y | sh -s -- --default-toolchain stable -y
COPY Cargo.lock . COPY Cargo.lock .
COPY Cargo.toml . COPY Cargo.toml .
COPY src/ ./src COPY src/ ./src
RUN $HOME/.cargo/bin/cargo fetch RUN $HOME/.cargo/bin/cargo fetch
RUN curl https://github.com/newrelic/c-sdk/archive/v1.3.0.tar.gz -L -o newrelic.tar.gz
RUN tar -xf newrelic.tar.gz
# NB: There's also a dynamic library target
# Static output is './c-sdk-1.3.0/libnewrelic.a'
RUN cd ./c-sdk-1.3.0 && make static
RUN cp ./c-sdk-1.3.0/libnewrelic.a .
#RUN LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} $HOME/.cargo/bin/cargo build #RUN LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} $HOME/.cargo/bin/cargo build
RUN LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} $HOME/.cargo/bin/cargo build --release RUN LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} $HOME/.cargo/bin/cargo build --release