Source
FROM stagex/pallet-gcc-cmake-busybox AS build
ARG VERSION
COPY --from=stagex/core-openssl . /
COPY --from=stagex/user-abseil-cpp . /
ADD fetch/protobuf-${VERSION}.tar.gz .
WORKDIR /protobuf-${VERSION}
RUN <<-EOF
set -eux
cmake \
-B build \
-G Ninja \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_ABSL_PROVIDER="package" \
-Dprotobuf_ALLOW_CCACHE=ON \
-Dprotobuf_USE_EXTERNAL_GTEST=ON
cmake --build build
DESTDIR="/rootfs" cmake --install build
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /