From 5a5f482d865e5ead486c67d915035011014a5069 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 7 Apr 2021 01:47:23 +0300 Subject: Dockerfile: best practices --- server/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/Dockerfile') diff --git a/server/Dockerfile b/server/Dockerfile index acb02e2..0ac89ee 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -3,9 +3,11 @@ FROM alpine:3.11 AS base +ARG src_dir=/usr/src/math-server + FROM base AS builder -ENV src_dir=/usr/src/math-server +ARG src_dir COPY [".", "$src_dir"] RUN build_deps='bash boost-dev cmake g++ make python3' && \ @@ -17,7 +19,8 @@ FROM base LABEL maintainer="Egor Tensin " -COPY --from=builder ["/usr/src/math-server/.build/install", "/opt/math-server"] +ARG src_dir +COPY --from=builder ["$src_dir/.build/install", "/opt/math-server"] RUN runtime_deps='boost-filesystem boost-program_options boost-regex boost-unit_test_framework libstdc++' && \ apk add $runtime_deps && \ -- cgit v1.2.3