upgrade module

This commit is contained in:
Oblivion 2023-08-27 09:05:40 +00:00
parent b2894cd02a
commit 3bad070c47
2 changed files with 12 additions and 18 deletions

View file

@ -21,7 +21,7 @@ COPY . /opt/third_party/
# install build tools # install build tools
RUN apk update \ RUN apk update \
&& apk upgrade \ && apk upgrade \
&& apk add -U bash cmake ninja \ && apk add -U bash \
&& bash /opt/third_party/build.sh -p && bash /opt/third_party/build.sh -p
ENV NINJA_STATUS "[%p/%f/%t] " ENV NINJA_STATUS "[%p/%f/%t] "
@ -57,6 +57,5 @@ RUN CGO_ENABLED=0 go build -o /go/bin/init_module
FROM cgr.dev/chainguard/static as final FROM cgr.dev/chainguard/static as final
COPY --from=build-init /go/bin/init_module / COPY --from=build-init /go/bin/init_module /
COPY --from=nginx /etc/nginx/modules /etc/nginx/modules COPY --from=nginx /etc/nginx/modules /etc/nginx/modules
COPY --from=nginx /opt/third_party/install/lib /etc/nginx/modules
CMD ["/init_module"] CMD ["/init_module"]

View file

@ -55,6 +55,8 @@ prepare()
{ {
apk add \ apk add \
linux-headers \ linux-headers \
cmake \
ninja \
openssl \ openssl \
curl-dev \ curl-dev \
openssl-dev \ openssl-dev \
@ -90,6 +92,7 @@ install_absl()
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-G Ninja \ -G Ninja \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=${INSTAL_DIR} \ -DCMAKE_INSTALL_PREFIX=${INSTAL_DIR} \
@ -148,7 +151,7 @@ install_nginx()
export NGINX_VERSION=1.21.6 export NGINX_VERSION=1.21.6
# Check for recent changes: https://github.com/open-telemetry/opentelemetry-cpp-contrib/compare/2656a4...main # Check for recent changes: https://github.com/open-telemetry/opentelemetry-cpp-contrib/compare/2656a4...main
export OPENTELEMETRY_CONTRIB_COMMIT=1ec94c82095bab61f06c7393b6f3272469d285af export OPENTELEMETRY_CONTRIB_COMMIT=aaa51e2297bcb34297f3c7aa44fa790497d2f7f3
mkdir -p /etc/nginx mkdir -p /etc/nginx
cd "$BUILD_PATH" cd "$BUILD_PATH"
@ -165,27 +168,19 @@ install_nginx()
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-G Ninja \ -G Ninja \
-DCMAKE_INSTALL_PREFIX=${INSTAL_DIR} \ -DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=ON \ -DCMAKE_INSTALL_PREFIX=${INSTAL_DIR} \
-DNGINX_VERSION=${NGINX_VERSION} \ -DBUILD_SHARED_LIBS=ON \
.. -DNGINX_VERSION=${NGINX_VERSION} \
..
cmake --build . -j ${CORES} --target install cmake --build . -j ${CORES} --target install
mkdir -p /etc/nginx/modules mkdir -p /etc/nginx/modules
ldd_output=$(ldd "${INSTAL_DIR}/otel_ngx_module.so" 2>&1)
if [ $? -ne 0 ]; then
echo "ldd encountered an error:"
echo "$ldd_output"
exit 1
fi
cp ${INSTAL_DIR}/otel_ngx_module.so /etc/nginx/modules/otel_ngx_module.so cp ${INSTAL_DIR}/otel_ngx_module.so /etc/nginx/modules/otel_ngx_module.so
mkdir -p ${INSTAL_DIR}/lib
} }
while getopts ":hpn:a:g:o:" option; do while getopts ":pha:g:o:n" option; do
case $option in case $option in
h) # display Help h) # display Help
Help Help