Skip to content

Commit

Permalink
Merge pull request #72 from zapier/split-apline-versions-in-build-pro…
Browse files Browse the repository at this point in the history
…cess

split alpine versions in build process
  • Loading branch information
mplachter authored Aug 21, 2023
2 parents 79e9d20 + 8b702dd commit 58169ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# builder image
FROM golang:1.19-alpine3.16 as builder
FROM golang:1.19-alpine3.17 as builder

ARG COMMIT_SHA
ARG VERSION_TAG
Expand All @@ -12,7 +12,7 @@ WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X ${GO_MOD_PATH}/config.CommitSHA=${COMMIT_SHA} -X ${GO_MOD_PATH}/config.Version=${VERSION_TAG}" -a -o prom-aggregation-gateway .

# generate clean, final image for end users
FROM alpine:3.16
FROM alpine:3.17
COPY --chown=nobody:nogroup --from=builder /build/prom-aggregation-gateway .

USER 65534
Expand Down
6 changes: 4 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ ARG commitSHA=""
ARG version="dev"
ARG PKG_PATH="github.com/zapier/prom-aggregation-gateway"

ARG ALPINE_VERSION="3.17"
ARG ALPINE_VERSION="3.17.5"
ARG GOLANG_ALPINE_VERSION="3.17"
ARG CHART_RELEASER_VERSION="1.4.1"
ARG CHART_TESTING_VERSION="3.7.1"
ARG GITHUB_CLI_VERSION="2.20.2"
Expand Down Expand Up @@ -35,7 +36,7 @@ release:
BUILD +build-image

go-deps:
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION}
FROM golang:${GOLANG_VERSION}-alpine${GOLANG_ALPINE_VERSION}

WORKDIR /src
COPY go.mod go.sum /src
Expand All @@ -57,6 +58,7 @@ build-image:
USER 65534
ENTRYPOINT ["/prom-aggregation-gateway"]
SAVE IMAGE --push ${image_name}:${version}
SAVE IMAGE --push ${image_name}:latest

continuous-deploy:
BUILD +build-helm
Expand Down

0 comments on commit 58169ca

Please sign in to comment.