Reduce the amount of layers docker uses
FROM golang:1.7-alpine
-# Install make and curl
-RUN apk --update add make curl git
-
# Set apps home directory.
ENV APP_DIR /go/src/github.com/hellofresh/janus
@@ -16,10 +13,12 @@ COPY . $APP_DIR
WORKDIR $APP_DIR
# Build the go binary
-RUN make
-
-# Clean apk cache
-RUN rm -rf /var/cache/apk/*
+RUN set -ex \
+ && apk add --no-cache --update --virtual .build-deps make curl git \
+ && make \
+ # Clean up
+ && apk del .build-deps \
+ && rm -rf /var/cache/apk/*
EXPOSE 8080
CMD janus
