From 0651e771231ca2a3ccf23cb141cb51ddf5152667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Wed, 9 Oct 2019 08:02:55 +0200 Subject: [PATCH] feat(docker): allow script-less build (#2337) --- bin/acore-docker-build-no-scripts | 9 +++++++++ docker/build/Dockerfile | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 bin/acore-docker-build-no-scripts diff --git a/bin/acore-docker-build-no-scripts b/bin/acore-docker-build-no-scripts new file mode 100755 index 000000000..f784a8504 --- /dev/null +++ b/bin/acore-docker-build-no-scripts @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +docker build --build-arg ENABLE_SCRIPTS=0 -t acbuild -f docker/build/Dockerfile . + +docker run \ + -v /$(pwd)/docker/build/cache:/azerothcore/build \ + -v /$(pwd)/docker/worldserver/bin:/binworldserver \ + -v /$(pwd)/docker/authserver/bin:/binauthserver \ + acbuild diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 3b533baa4..d1fec9bf0 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -11,9 +11,12 @@ ADD src /azerothcore/src ADD modules /azerothcore/modules ADD CMakeLists.txt /azerothcore/CMakeLists.txt +ARG ENABLE_SCRIPTS=1 +ENV ENABLE_SCRIPTS=$ENABLE_SCRIPTS + ENTRYPOINT cd azerothcore/build && \ # run cmake - cmake ../ -DCMAKE_INSTALL_PREFIX=/azeroth-server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=0 -DSCRIPTS=1 && \ + cmake ../ -DCMAKE_INSTALL_PREFIX=/azeroth-server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=0 -DSCRIPTS=$ENABLE_SCRIPTS && \ # calculate the optimal number of threads MTHREADS=`grep -c ^processor /proc/cpuinfo`; MTHREADS=$(($MTHREADS + 2)) && \ # run compilation