mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
update dependencie docker to allow different build types
This commit is contained in:
parent
68f3c3736d
commit
d1da7b72b2
@ -9,79 +9,65 @@ RUN apk add --no-cache git openssl-dev make gcc musl-dev g++ linux-headers libin
|
|||||||
##### CMAKE #####
|
##### CMAKE #####
|
||||||
FROM alpine-build as alpine-gxx-cmake
|
FROM alpine-build as alpine-gxx-cmake
|
||||||
|
|
||||||
USER root
|
|
||||||
ENV DOCKER_WORKDIR="/code"
|
|
||||||
|
|
||||||
RUN mkdir -p ${DOCKER_WORKDIR}
|
|
||||||
WORKDIR ${DOCKER_WORKDIR}
|
|
||||||
|
|
||||||
RUN git clone https://github.com/Kitware/CMake.git --branch=v3.19.8 && \
|
RUN git clone https://github.com/Kitware/CMake.git --branch=v3.19.8 && \
|
||||||
cd CMake && \
|
cd CMake && \
|
||||||
./bootstrap --parallel=$(nproc) && \
|
./bootstrap --parallel=$(nproc) && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install && \
|
make install
|
||||||
cd .. && \
|
|
||||||
rm -rf CMake
|
|
||||||
|
|
||||||
RUN ls -la /usr/include/boost
|
######### BUILD grpc ##############
|
||||||
|
FROM alpine-gxx-cmake as alpine-gxx-grpc
|
||||||
|
|
||||||
##### BUILD ENV ##############
|
ARG BUILD_TYPE=Debug
|
||||||
FROM alpine-build as build_debug_dependencies
|
|
||||||
|
|
||||||
USER root
|
RUN git clone https://github.com/grpc/grpc.git --branch=v1.37.0 --recursive -j4 && \
|
||||||
ENV DOCKER_WORKDIR="/code"
|
cd grpc && \
|
||||||
|
mkdir build && cd build && \
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||||
|
make install
|
||||||
|
|
||||||
RUN mkdir -p ${DOCKER_WORKDIR}
|
######### BUILD poco ##############
|
||||||
WORKDIR ${DOCKER_WORKDIR}
|
FROM alpine-gxx-cmake as alpine-gxx-poco
|
||||||
|
|
||||||
RUN apk add --no-cache git make gettext openssl-dev
|
ARG BUILD_TYPE=Debug
|
||||||
# copy CMake from last stage
|
|
||||||
COPY --from=alpine-gxx-cmake /usr/local/bin/cmake /usr/local/bin/cmake
|
|
||||||
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Modules /usr/local/share/cmake-3.19/Modules
|
|
||||||
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Templates /usr/local/share/cmake-3.19/Templates
|
|
||||||
|
|
||||||
|
RUN git clone https://github.com/pocoproject/poco.git --recursive && \
|
||||||
|
cd poco && \
|
||||||
|
git checkout poco-1.9.4-release && \
|
||||||
|
mkdir cmake-build && cd cmake-build && \
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||||
|
make install
|
||||||
|
|
||||||
|
######### BUILD mariadb ###########
|
||||||
|
FROM alpine-gxx-cmake as alpine-gxx-mariadb-connector
|
||||||
|
|
||||||
# COPY files from context
|
ARG BUILD_TYPE=Debug
|
||||||
COPY ./dependencies ./dependencies
|
|
||||||
COPY ./scripts ./scripts
|
|
||||||
COPY ./CMakeLists.txt .
|
|
||||||
COPY ./src ./src
|
|
||||||
|
|
||||||
# run build
|
RUN git clone https://github.com/mariadb-corporation/mariadb-connector-c.git && \
|
||||||
RUN cd scripts && \
|
cd mariadb-connector-c && \
|
||||||
chmod +x ./prepare_build.sh && \
|
git checkout 159540f && \
|
||||||
./prepare_build.sh && \
|
mkdir build && cd build && \
|
||||||
mkdir ../build && \
|
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make -j$(nproc) && \
|
||||||
chmod +x ./build_debug.sh && \
|
make install
|
||||||
./build_debug.sh
|
|
||||||
|
|
||||||
#########################################################################################################
|
#########################################################################################################
|
||||||
# builded libs and binaries
|
# builded libs and binaries
|
||||||
#########################################################################################################
|
#########################################################################################################
|
||||||
FROM alpine-build as debug_builded
|
FROM alpine-build as alpine-libs
|
||||||
|
|
||||||
USER root
|
# copy CMake from cmake stage
|
||||||
ENV DOCKER_WORKDIR="/code"
|
COPY --from=alpine-gxx-cmake /usr/local/bin/cmake /usr/local/bin/cmake
|
||||||
|
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Modules /usr/local/share/cmake-3.19/Modules
|
||||||
|
COPY --from=alpine-gxx-cmake /usr/local/share/cmake-3.19/Templates /usr/local/share/cmake-3.19/Templates
|
||||||
|
|
||||||
RUN mkdir -p ${DOCKER_WORKDIR}
|
# copy from grpc
|
||||||
WORKDIR ${DOCKER_WORKDIR}
|
COPY --from=alpine-gxx-grpc /usr/local /usr/local
|
||||||
|
|
||||||
RUN apk add --no-cache bash
|
|
||||||
|
# COPY from poco
|
||||||
# copy CMake from last stage
|
COPY --from=alpine-gxx-poco /usr/local /usr/local
|
||||||
COPY --from=build_debug_dependencies /usr/local/bin/cmake /usr/local/bin/cmake
|
|
||||||
COPY --from=build_debug_dependencies /usr/local/share/cmake-3.19 /usr/local/share/cmake-3.19
|
# COPY from mariadb
|
||||||
|
COPY --from=alpine-gxx-mariadb-connector /usr/local /usr/local
|
||||||
COPY --from=build_debug_dependencies /code/build/bin ${DOCKER_WORKDIR}/pre_build/bin
|
|
||||||
COPY --from=build_debug_dependencies /code/build/lib ${DOCKER_WORKDIR}/pre_build/lib
|
|
||||||
|
|
||||||
# grpc
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/grpc/lib ${DOCKER_WORKDIR}/pre_build/dependencies/grpc/lib
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/grpc/third_party/protobuf/lib ${DOCKER_WORKDIR}/pre_build/dependencies/grpc/third_party/protobuf/lib
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/grpc/third_party/re2/lib ${DOCKER_WORKDIR}/pre_build/dependencies/grpc/third_party/re2/lib
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/grpc/third_party/zlib/lib ${DOCKER_WORKDIR}/pre_build/dependencies/grpc/third_party/zlib/lib
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/grpc/third_party/cares/cares/lib ${DOCKER_WORKDIR}/pre_build/dependencies/grpc/third_party/cares/cares/lib
|
|
||||||
COPY --from=build_debug_dependencies /code/build/dependencies/mariadb-connector-c/libmariadb/lib ${DOCKER_WORKDIR}/pre_build/dependencies/mariadb-connector-c/libmariadb/lib
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user