From 8c12d92c07906dc1c8c24a04f64a3470de8b06e7 Mon Sep 17 00:00:00 2001 From: Bohan Chen Date: Mon, 11 Feb 2019 15:30:15 -0500 Subject: [PATCH 1/3] switch to ubuntu:bionic base image Signed-off-by: Bohan Chen --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5d52565..6c1006f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:alpine as builder +FROM concourse/golang-builder as builder COPY . /go/src/github.com/concourse/github-release-resource ENV CGO_ENABLED 0 ENV GOPATH /go/src/github.com/concourse/github-release-resource/Godeps/_workspace:${GOPATH} @@ -10,8 +10,11 @@ RUN set -e; for pkg in $(go list ./...); do \ go test -o "/tests/$(basename $pkg).test" -c $pkg; \ done -FROM alpine:edge AS resource -RUN apk add --update bash tzdata ca-certificates +FROM ubuntu:bionic AS resource +RUN apt-get update && apt-get install -y --no-install-recommends \ + tzdata \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* COPY --from=builder /assets /opt/resource FROM resource AS tests From e5c14eca838efeabcecdcd53a5e3e958cad0019f Mon Sep 17 00:00:00 2001 From: Bishoy Youssef Date: Thu, 21 Feb 2019 11:48:27 -0500 Subject: [PATCH 2/3] moving dockerfiles to a separate folder Signed-off-by: Bishoy Youssef Co-authored-by: Bohan Chen --- dockerfiles/alpine/Dockerfile | 23 +++++++++++++++++++++ Dockerfile => dockerfiles/ubuntu/Dockerfile | 0 2 files changed, 23 insertions(+) create mode 100644 dockerfiles/alpine/Dockerfile rename Dockerfile => dockerfiles/ubuntu/Dockerfile (100%) diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile new file mode 100644 index 0000000..5d52565 --- /dev/null +++ b/dockerfiles/alpine/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:alpine as builder +COPY . /go/src/github.com/concourse/github-release-resource +ENV CGO_ENABLED 0 +ENV GOPATH /go/src/github.com/concourse/github-release-resource/Godeps/_workspace:${GOPATH} +ENV PATH /go/src/github.com/concourse/github-release-resource/Godeps/_workspace/bin:${PATH} +RUN go build -o /assets/out github.com/concourse/github-release-resource/cmd/out +RUN go build -o /assets/in github.com/concourse/github-release-resource/cmd/in +RUN go build -o /assets/check github.com/concourse/github-release-resource/cmd/check +RUN set -e; for pkg in $(go list ./...); do \ + go test -o "/tests/$(basename $pkg).test" -c $pkg; \ + done + +FROM alpine:edge AS resource +RUN apk add --update bash tzdata ca-certificates +COPY --from=builder /assets /opt/resource + +FROM resource AS tests +COPY --from=builder /tests /tests +RUN set -e; for test in /tests/*.test; do \ + $test; \ + done + +FROM resource diff --git a/Dockerfile b/dockerfiles/ubuntu/Dockerfile similarity index 100% rename from Dockerfile rename to dockerfiles/ubuntu/Dockerfile From bd6d7eb1d2d82f530b54074ca89ed578a9c83b7e Mon Sep 17 00:00:00 2001 From: Bin Ju Date: Mon, 18 Mar 2019 16:42:32 -0400 Subject: [PATCH 3/3] update README to reference new dockerfiles Signed-off-by: Bin Ju Co-authored-by: Bohan Chen --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9237074..223c736 100644 --- a/README.md +++ b/README.md @@ -181,10 +181,11 @@ environment is consistent across any `docker` enabled platform. When the docker image builds, the test are run inside the docker container, on failure they will stop the build. -Run the tests with the following command: +Run the tests with the following commands for both `alpine` and `ubuntu` images: ```sh -docker build -t github-release-resource . +docker build -t github-release-resource -f dockerfiles/alpine/Dockerfile . +docker build -t github-release-resource -f dockerfiles/ubuntu/Dockerfile . ``` ### Contributing