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 babf5a7 commit e940f8f
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,5 +1,8 @@
ARG base_image=alpine:latest
ARG builder_image=concourse/golang-builder

# stage: builder
FROM concourse/golang-builder AS builder
FROM ${builder_image} AS builder

WORKDIR /concourse/docker-image-resource
COPY go.mod .
Expand All @@ -18,7 +21,7 @@ RUN set -e; \
done

# stage: resource
FROM alpine:edge AS resource
FROM ${base_image} AS resource
RUN apk --no-cache add \
bash \
docker \
Expand Down
7 changes: 5 additions & 2 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ARG base_image
ARG builder_image=concourse/golang-builder

# stage: builder
FROM concourse/golang-builder AS builder
FROM ${builder_image} AS builder

WORKDIR /concourse/docker-image-resource
COPY go.mod .
Expand All @@ -18,7 +21,7 @@ RUN set -e; \
done

# stage: resource
FROM ubuntu:bionic AS resource
FROM ${base_image} AS resource

# docker hosts their own packages, this steps sets up the repo for apt-get
RUN apt-get update; \
Expand Down

0 comments on commit e940f8f

Please sign in to comment.