Skip to content

Commit

Permalink
Create Dockerfile.linux
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Nov 26, 2023
1 parent 3cb2a7d commit ab442d4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CMake build directory
/build
/build_*
/_build
/_build_*
/cmake-build-*
/containers

# macOS garbage
.DS_Store
35 changes: 35 additions & 0 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions containers/linux/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions containers/linux/build-bhl.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit ab442d4

Please sign in to comment.