Skip to content

Commit

Permalink
use build arg for base image
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Suraci <[email protected]>
  • Loading branch information
vito committed Jan 8, 2021
1 parent 591e9fc commit 240ecd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dockerfiles/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG base_image=alpine:edge

FROM golang:1 as builder
COPY . /src
WORKDIR /src
Expand All @@ -11,7 +13,7 @@ RUN go build -o /assets/check ./cmd/check
# no-op
FROM scratch AS tests

FROM alpine:edge
FROM ${base_image}
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*
RUN apk --no-cache add bash wget netcat-openbsd
4 changes: 3 additions & 1 deletion dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG base_image=ubuntu:bionic

FROM concourse/golang-builder as builder
COPY . /src
WORKDIR /src
Expand All @@ -11,7 +13,7 @@ RUN go build -o /assets/check ./cmd/check
# no-op
FROM scratch AS tests

FROM ubuntu:bionic AS resource
FROM ${base_image} AS resource
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*
RUN apt-get update && apt-get -y install wget netcat-openbsd

0 comments on commit 240ecd9

Please sign in to comment.