Skip to content

Commit

Permalink
Merge pull request #320 from concourse/image-args
Browse files Browse the repository at this point in the history
use image args for FROM, use golang-builder
  • Loading branch information
vito authored Jan 14, 2021
2 parents babf5a7 + e940f8f commit 6a27ae9
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 6a27ae9

Please sign in to comment.