Skip to content

Commit

Permalink
fix: correct binary client creation based on alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
ngruelaneo committed Dec 10, 2024
1 parent 2f2be75 commit 21e8df3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cpp/tools/packaging/make-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -x
script_path="$(readlink -f "${BASH_SOURCE:-$0}")"
script_dir="$(dirname "$script_path")"
docker build -t "debbuild" -f deb.Dockerfile --progress=plain "${script_dir}/../../../.."
docker buildx build -t "debbuild" -f deb.Dockerfile --progress=plain "${script_dir}/../../../.."
docker run --rm -v ".:/host" --entrypoint bash "debbuild" -c "cp ./*.deb /host/"
2 changes: 1 addition & 1 deletion packages/cpp/tools/packaging/make-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -x
script_path="$(readlink -f "${BASH_SOURCE:-$0}")"
script_dir="$(dirname "$script_path")"
docker build -t "rpmbuild" -f ubi7.Dockerfile --progress=plain "${script_dir}/../../../.."
docker buildx build -t "rpmbuild" -f ubi7.Dockerfile --progress=plain "${script_dir}/../../../.."
docker run --rm -v ".:/host" --entrypoint bash "rpmbuild" -c "cp /rpm/build/*.rpm /host/"
6 changes: 4 additions & 2 deletions packages/cpp/tools/packaging/make-tar.gz.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
set -ex
../compile.sh
cp ../../build/*.tar.gz .
script_path="$(readlink -f "${BASH_SOURCE:-$0}")"
script_dir="$(dirname "$script_path")"
docker buildx build -t "tgzalpinebuild" -f "${script_dir}/tgz_alpine.Dockerfile" --progress=plain "${script_dir}/../../../.."
docker run --rm -v ".:/host" --entrypoint sh "tgzalpinebuild" -c "cp ./*.tar.gz /host/"

51 changes: 51 additions & 0 deletions packages/cpp/tools/packaging/tgz_alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Start with the latest Alpine base image for the build stage
FROM alpine AS builder
ARG GRPC_VERSION=v1.54.0

# Install all the necessary dependencies required for the build process
# These include tools and libraries for building and compiling the source code
RUN apk update && apk add --no-cache \
git \
gcc \
g++ \
build-base \
autoconf \
automake \
libtool \
curl \
c-ares \
c-ares-dev \
make \
cmake \
unzip \
linux-headers \
grpc \
grpc-dev \
protobuf \
protobuf-dev

# Update the PATH environment variable to include the gRPC libraries and binaries
ENV LD_LIBRARY_PATH="/app/install/lib:$LD_LIBRARY_PATH"
ENV PATH="/app/install/bin:$PATH"

# Display the updated PATH environment variable
RUN echo $PATH

# Copy the application source files into the image
WORKDIR /app/libarmonik
COPY packages/cpp/tools/packaging/common/. ./tools/packaging/common/
COPY Protos/V1/. ./Protos/
COPY packages/cpp/ArmoniK.Api.Common/. ./ArmoniK.Api.Common/
COPY packages/cpp/ArmoniK.Api.Client/. ./ArmoniK.Api.Client/
COPY packages/cpp/ArmoniK.Api.Worker/. ./ArmoniK.Api.Worker/
COPY packages/cpp/CMakeLists.txt .
COPY packages/cpp/Packaging.cmake .
COPY packages/cpp/Dependencies.cmake .

# Build the application using the copied source files and protobuf definitions
WORKDIR /app/libarmonik/build
RUN cmake -DCMAKE_INSTALL_PREFIX="/app/install" -DPROTO_FILES_DIR="/app/proto" -DBUILD_TEST=OFF \
-DBUILD_CLIENT=ON -DBUILD_WORKER=OFF -DPROTO_FILES_DIR=/app/libarmonik/Protos \
-DCPACK_GENERATOR=TGZ /app/libarmonik && \
make -j $(nproc) && \
make package -j

0 comments on commit 21e8df3

Please sign in to comment.