Skip to content

Commit

Permalink
use image args for FROM, use golang-builder
Browse files Browse the repository at this point in the history
concourse/concourse#6425

Signed-off-by: Alex Suraci <[email protected]>
  • Loading branch information
vito committed Jan 14, 2021
1 parent 1c60008 commit 03e8d70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions dockerfiles/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . /go/src/github.com/concourse/s3-resource
WORKDIR /go/src/github.com/concourse/s3-resource
ENV CGO_ENABLED 0
Expand All @@ -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 --no-cache bash tzdata ca-certificates unzip zip gzip tar
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*
Expand Down
7 changes: 5 additions & 2 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . /go/src/github.com/concourse/s3-resource
WORKDIR /go/src/github.com/concourse/s3-resource
ENV CGO_ENABLED 0
Expand All @@ -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 \
Expand Down

0 comments on commit 03e8d70

Please sign in to comment.