diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile index 1686a4d..1306b57 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 WORKDIR /concourse/time-resource COPY go.mod . COPY go.sum . @@ -12,7 +15,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 COPY --from=builder /assets /opt/resource diff --git a/dockerfiles/ubuntu/Dockerfile b/dockerfiles/ubuntu/Dockerfile index 54c98d0..36bfb4f 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 WORKDIR /concourse/time-resource COPY go.mod . COPY go.sum . @@ -12,7 +15,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 \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /assets /opt/resource