From 4a73da2b2ab8cc4ee5a5327368877d741f0fe4f6 Mon Sep 17 00:00:00 2001 From: Alex Suraci Date: Wed, 13 Jan 2021 22:14:16 -0500 Subject: [PATCH] use image args for FROM, use golang-builder concourse/concourse#6425 Signed-off-by: Alex Suraci --- dockerfiles/alpine/Dockerfile | 7 +++++-- dockerfiles/ubuntu/Dockerfile | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile index c1dce7d..b877c6c 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 . /src WORKDIR /src 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 3f4412b..7b2c6e5 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 . /src WORKDIR /src 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 ubuntu:bionic AS resource +FROM ${base_image} AS resource RUN apt-get update && apt-get install -y --no-install-recommends \ tzdata \ ca-certificates \