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 --- client/Dockerfile | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'client/Dockerfile') diff --git a/client/Dockerfile b/client/Dockerfile index 44b20ec..e053956 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,33 +1,27 @@ # To build, run from the top-level directory: # docker build -f client/Dockerfile -t egortensin/math-client . -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 ENTRYPOINT ["/usr/local/bin/math-client"] CMD ["-c", "2 * 2"] -- cgit v1.2.3