summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Viennot <nicolas@viennot.biz>2019-11-28 16:30:32 -0500
committerNicolas Viennot <nicolas@viennot.biz>2019-11-28 16:35:48 -0500
commitf0a4707ef35b04afb87092f11782f63776b3cdec (patch)
treee9fc21e3ababa98b16cec244737ad797443bf818
parent5e00bfa5e137e76c81888727712ced2b3fd99f5b (diff)
Update dockerfile for size
-rw-r--r--Dockerfile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 8b736f63..2f6387c5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
ARG PLATFORM=amd64
-FROM ${PLATFORM}/alpine:3.10
+FROM ${PLATFORM}/alpine:3.10 AS build
WORKDIR /build
@@ -25,5 +25,13 @@ COPY *.c *.h autogen.sh Makefile.am configure.ac ./
RUN ./autogen.sh && ./configure --enable-static
RUN make -j $(nproc)
-RUN objcopy --only-keep-debug tmate tmate.symbols && strip tmate
+RUN objcopy --only-keep-debug tmate tmate.symbols && chmod -x tmate.symbols && strip tmate
RUN ./tmate -V
+
+FROM alpine:3.9
+
+RUN apk --no-cache add bash
+RUN mkdir /build
+ENV PATH=/build:$PATH
+COPY --from=build /build/tmate.symbols /build
+COPY --from=build /build/tmate /build