diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-30 10:59:31 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-30 10:59:31 +0300 |
commit | 4dee333c665a0664012b76a6f45f59009f6638c9 (patch) | |
tree | eb36aa2aaa90a9c981bb76acd08521c2d2471760 /server/Dockerfile | |
parent | add licensing notes to source files (diff) | |
download | math-server-4dee333c665a0664012b76a6f45f59009f6638c9.tar.gz math-server-4dee333c665a0664012b76a6f45f59009f6638c9.zip |
Docker: debian -> alpine
Diffstat (limited to '')
-rw-r--r-- | server/Dockerfile | 38 |
1 files changed, 16 insertions, 22 deletions
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 <Egor.Tensin@gmail.com>" -# 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"] |