From d8ad49d14d6aaae26fc7437d3b9a597353b0aeec Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 28 Dec 2019 11:23:25 -0800 Subject: Remove dependency on Sed to build Docker images - Keep the Dockerfile standard and avoid external dependencies - Use build args instead of Sed - Bump Alpine Linux to version 3.11 - Always use the latest version of Golang --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index da33ff1..16049d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,19 @@ -FROM golang:1.13-alpine3.10 as build -ENV GO111MODULE=on +ARG BASE_IMAGE_ARCH="amd64" +ARG ALPINE_LINUX_VERSION="3.11" + +FROM golang:1-alpine${ALPINE_LINUX_VERSION} as build +ARG APP_VERSION +ARG APP_ARCH="amd64" WORKDIR /go/src/app RUN apk add --no-cache --update build-base git COPY . . -RUN make linux-__MINIFLUX_ARCH__ VERSION=__MINIFLUX_VERSION__ +RUN make linux-${APP_ARCH} VERSION=${APP_VERSION} +RUN cp /go/src/app/miniflux-linux-${APP_ARCH} /go/src/app/miniflux -FROM __BASEIMAGE_ARCH__/alpine:3.10.3 +FROM ${BASE_IMAGE_ARCH}/alpine:${ALPINE_LINUX_VERSION} EXPOSE 8080 ENV LISTEN_ADDR 0.0.0.0:8080 RUN apk --no-cache add ca-certificates tzdata -COPY --from=build /go/src/app/miniflux-linux-__MINIFLUX_ARCH__ /usr/bin/miniflux +COPY --from=build /go/src/app/miniflux /usr/bin/miniflux USER nobody CMD ["/usr/bin/miniflux"] -- cgit v1.2.3