diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile index 9a97e9d..7d2a05d 100644 --- a/dockerfiles/alpine/Dockerfile +++ b/dockerfiles/alpine/Dockerfile @@ -1,4 +1,7 @@ -FROM golang:alpine AS builder +ARG base_image=alpine:latest +ARG builder_image=concourse/golang-builder + +FROM ${builder_image} AS builder COPY . $GOPATH/src/github.com/concourse/github-release-resource WORKDIR $GOPATH/src/github.com/concourse/github-release-resource ENV CGO_ENABLED 0 @@ -10,7 +13,7 @@ RUN set -e; for pkg in $(go list ./...); do \ go test -o "/tests/$(basename $pkg).test" -c $pkg; \ done -FROM alpine:edge AS resource +FROM ${base_image} AS resource RUN apk add --update bash tzdata ca-certificates COPY --from=builder /assets /opt/resource diff --git a/dockerfiles/ubuntu/Dockerfile b/dockerfiles/ubuntu/Dockerfile index 8af8a94..c494927 100644 --- a/dockerfiles/ubuntu/Dockerfile +++ b/dockerfiles/ubuntu/Dockerfile @@ -1,4 +1,7 @@ -FROM concourse/golang-builder as builder +ARG base_image +ARG builder_image=concourse/golang-builder + +FROM ${builder_image} as builder COPY . $GOPATH/src/github.com/concourse/github-release-resource ENV CGO_ENABLED 0 WORKDIR $GOPATH/src/github.com/concourse/github-release-resource @@ -10,7 +13,7 @@ RUN set -e; for pkg in $(go list ./...); do \ go test -o "/tests/$(basename $pkg).test" -c $pkg; \ done -FROM ubuntu:bionic AS resource +FROM ${base_image} AS resource RUN apt-get update && apt-get install -y --no-install-recommends \ tzdata \ ca-certificates \