diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..e42662cb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +# CMake build directory +/build +/build_* +/_build +/_build_* +/cmake-build-* +/containers + +# macOS garbage +.DS_Store diff --git a/Dockerfile.linux b/Dockerfile.linux new file mode 100644 index 00000000..d06deabf --- /dev/null +++ b/Dockerfile.linux @@ -0,0 +1,35 @@ +FROM bhl-build + +# Install build script dependencies +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt-get update +RUN apt-get install -y \ + python3.8 \ + python3.8-venv \ + python3.8-distutils \ + git + +# Install build dependencies +RUN apt-get update +RUN apt-get install -y \ + zlib1g:i386 \ + zlib1g-dev:i386 + +WORKDIR /build/bhl +COPY . . + +RUN python3.8 ./scripts/BuildRelease.py \ + --target client \ + --build-type release \ + --vs 2019 --toolset v141_xp \ + --linux-compiler gcc-9 \ + --out-dir ./_build_out_client \ + --cmake-args="-DWARNINGS_ARE_ERRORS=ON" + +RUN python3.8 ./scripts/BuildRelease.py \ + --target server \ + --build-type release \ + --vs 2019 --toolset v141_xp \ + --linux-compiler gcc-9 \ + --out-dir ./_build_out_server \ + --cmake-args="-DWARNINGS_ARE_ERRORS=ON" diff --git a/containers/linux/README.txt b/containers/linux/README.txt index a5eea980..38eb2a56 100644 --- a/containers/linux/README.txt +++ b/containers/linux/README.txt @@ -5,3 +5,6 @@ Build order: 3. build-libzip.sh 4. build-mbedtls.sh 5. build-bhl.sh + +To open bash + docker run --rm -it --entrypoint bash bhl-build diff --git a/containers/linux/build-bhl.sh b/containers/linux/build-bhl.sh new file mode 100755 index 00000000..105f3bb8 --- /dev/null +++ b/containers/linux/build-bhl.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +CUR_DIR="containers/linux" + +IMAGE_TAG="bhl-build-bhl" +TEMP_CONT="${IMAGE_TAG}-temp" +DOCKERFILE="Dockerfile.linux" +OUT_DIR="$CUR_DIR/out/bhl" + +cd ../.. +mkdir -p $OUT_DIR + +docker buildx build -f $DOCKERFILE -t $IMAGE_TAG . +docker container create --name $TEMP_CONT $IMAGE_TAG +docker container cp ${TEMP_CONT}:/build/bhl/_build_out_client/. $OUT_DIR +docker container cp ${TEMP_CONT}:/build/bhl/_build_out_server/. $OUT_DIR +docker container rm ${TEMP_CONT}