feat(docker): add cache for faster rebuild (#1507)

- Closes #1502
This commit is contained in:
Francesco Borzì
2019-02-23 17:34:56 +01:00
committed by GitHub
parent 53098cd1e0
commit e659ca5fe9
14 changed files with 64 additions and 21 deletions

View File

@@ -8,10 +8,10 @@ ADD conf/config.cmake.dist /azerothcore/conf/config.cmake.dist
ADD src /azerothcore/src
ADD CMakeLists.txt /azerothcore/CMakeLists.txt
RUN cd azerothcore; \
mkdir build; \
cd build; \
cmake ../ -DCMAKE_INSTALL_PREFIX=/azeroth-server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=0 -DSCRIPTS=1; \
MTHREADS=`grep -c ^processor /proc/cpuinfo`; MTHREADS=$(($MTHREADS + 2)); \
make -j $MTHREADS; \
make install -j $MTHREADS;
ENTRYPOINT cd azerothcore/build && \
cmake ../ -DCMAKE_INSTALL_PREFIX=/azeroth-server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=0 -DSCRIPTS=1 && \
MTHREADS=`grep -c ^processor /proc/cpuinfo`; MTHREADS=$(($MTHREADS + 2)) && \
make -j $MTHREADS && \
make install -j $MTHREADS && \
cp /azeroth-server/bin/worldserver /binworldserver && \
cp /azeroth-server/bin/authserver /binauthserver