This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
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 #24 from concourse/bionic-base-image
Migrating to ubuntu:bionic and golang-builder
- Loading branch information
Showing
3 changed files
with
60 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,31 @@ | ||
FROM concourse/golang-builder as builder | ||
COPY . /go/src/github.com/concourse/tracker-resource | ||
ENV CGO_ENABLED 0 | ||
ENV GOPATH /go/src/github.com/concourse/tracker-resource/Godeps/_workspace:${GOPATH} | ||
ENV PATH /go/src/github.com/concourse/tracker-resource/Godeps/_workspace/bin:${PATH} | ||
RUN go build -o /assets/out github.com/concourse/tracker-resource/out/cmd/out | ||
RUN go build -o /assets/in github.com/concourse/tracker-resource/in/cmd/in | ||
RUN go build -o /assets/check github.com/concourse/tracker-resource/check/cmd/check | ||
RUN set -e; mkdir /tests; for pkg in $(go list ./...); do \ | ||
cp -a $(go list -f '{{.Dir}}' $pkg) /tests/$(basename $pkg); \ | ||
go test -o "/tests/$(basename $pkg)/run" -c $pkg; \ | ||
done | ||
|
||
FROM ubuntu:bionic AS resource | ||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install -y --no-install-recommends \ | ||
tzdata \ | ||
ca-certificates \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /assets /opt/resource | ||
|
||
FROM resource AS tests | ||
COPY --from=builder /tests /tests | ||
RUN set -e; for test in /tests/*/run; do \ | ||
cd $(dirname $test); \ | ||
./run; \ | ||
done | ||
|
||
FROM resource |