From 4dee333c665a0664012b76a6f45f59009f6638c9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 30 Dec 2019 10:59:31 +0300 Subject: Docker: debian -> alpine --- server/Dockerfile | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'server/Dockerfile') diff --git a/server/Dockerfile b/server/Dockerfile index f5248ae..27aab08 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,32 +1,26 @@ # To build, run from the top-level directory: # docker build -f server/Dockerfile -t egortensin/math-server . -FROM debian +FROM alpine:3.11 LABEL maintainer="Egor Tensin " -# Don't prompt: -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -yq \ - && apt-get install -yq --no-install-recommends \ - build-essential \ - cmake \ - libboost-filesystem-dev \ - libboost-program-options-dev \ - libboost-test-dev \ - python3 - -ENV src_dir=/usr/src/app - +ENV src_dir=/usr/src/math-server COPY [".", "$src_dir"] -RUN "$src_dir/cmake/ci/build.py" \ - --src "$src_dir" \ - --install /usr/local \ - --clean \ - --configuration Release \ - -- -DENABLE_TESTS=ON \ - && /usr/local/bin/math-server-unit-tests --log_level=all +RUN build_deps='boost-dev cmake g++ make python3' && \ + apk add --no-cache $build_deps && \ + "$src_dir/cmake/ci/build.py" \ + --src "$src_dir" \ + --install /usr/local \ + --clean \ + --configuration Release \ + -- -D ENABLE_TESTS=ON \ + -- -D Boost_USE_STATIC_LIBS=OFF && \ + rm -rf -- "$src_dir" && \ + apk del --purge --rdepends $build_deps && \ + runtime_deps='boost-filesystem boost-program_options boost-unit_test_framework libstdc++' && \ + apk add $runtime_deps && \ + /usr/local/bin/math-server-unit-tests --log_level=all CMD ["/usr/local/bin/math-server"] -- cgit v1.2.3