From 4ffc65b3eb18eba44846436f61f1f59be14bb361 Mon Sep 17 00:00:00 2001 From: ant Date: Sat, 23 Mar 2019 18:04:02 +0000 Subject: [PATCH] Make final docker image smaller --- Dockerfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8494fb..a819488 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,15 @@ -FROM gliderlabs/alpine:3.4 -RUN \ - apk add --no-cache make gcc git libc-dev && \ - git clone https://github.com/skeeto/endlessh && \ - cd endlessh && \ - make +FROM alpine:3.9 as builder +RUN apk add --no-cache build-base +ADD endlessh.c Makefile / +RUN make + + +FROM alpine:3.9 + +COPY --from=builder /endlessh / + EXPOSE 2222/tcp -ENTRYPOINT /endlessh/endlessh + +ENTRYPOINT ["/endlessh"] + +CMD ["-v"]