-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from concourse/bionic-base-image
migrating to ubuntu:bionic and golang-builder
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM concourse/golang-builder as builder | ||
COPY . /src | ||
WORKDIR /src | ||
ENV CGO_ENABLED 0 | ||
RUN go get -d ./... | ||
RUN go build -o /assets/in ./cmd/in | ||
RUN go build -o /assets/out ./cmd/out | ||
RUN go build -o /assets/check ./cmd/check | ||
RUN set -e; for pkg in $(go list ./...); do \ | ||
go test -o "/tests/$(basename $pkg).test" -c $pkg; \ | ||
done | ||
|
||
FROM ubuntu:bionic AS resource | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
tzdata \ | ||
ca-certificates \ | ||
unzip \ | ||
zip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder assets/ /opt/resource/ | ||
RUN chmod +x /opt/resource/* | ||
|
||
FROM resource AS tests | ||
COPY --from=builder /tests /tests | ||
ADD . /docker-image-resource | ||
ARG DOCKER_PRIVATE_USERNAME | ||
ARG DOCKER_PRIVATE_PASSWORD | ||
ARG DOCKER_PRIVATE_REPO | ||
ARG DOCKER_PUSH_USERNAME | ||
ARG DOCKER_PUSH_PASSWORD | ||
ARG DOCKER_PUSH_REPO | ||
RUN set -e; for test in /tests/*.test; do \ | ||
$test -ginkgo.v; \ | ||
done | ||
|
||
FROM resource |