File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ARG base_image=concourse/resource-types- base-image-static:latest
1+ ARG base_image=cgr.dev/chainguard/wolfi- base
22ARG builder_image=concourse/golang-builder
33
4- FROM ${builder_image} AS builder
5- COPY . $GOPATH/src/github.com/concourse/github-release-resource
4+ ARG BUILDPLATFORM
5+ FROM --platform=${BUILDPLATFORM} ${builder_image} AS builder
6+
7+ ARG TARGETOS
8+ ARG TARGETARCH
9+ ENV GOOS=$TARGETOS
10+ ENV GOARCH=$TARGETARCH
11+
12+ COPY . /src
13+ WORKDIR /src
614ENV CGO_ENABLED=0
7- WORKDIR $GOPATH/src/github.com/concourse/github-release-resource
8- RUN go mod vendor
9- RUN go build -o /assets/out github.com/concourse/github-release-resource/cmd/out
10- RUN go build -o /assets/in github.com/concourse/github-release-resource/cmd/in
11- RUN go build -o /assets/check github.com/concourse/github-release-resource/cmd/check
15+ RUN go mod download
16+ RUN go build -o /assets/out ./cmd/out
17+ RUN go build -o /assets/in ./cmd/in
18+ RUN go build -o /assets/check ./cmd/check
1219RUN set -e; for pkg in $(go list ./...); do \
1320 go test -o "/tests/$(basename $pkg).test" -c $pkg; \
1421 done
1522
1623FROM ${base_image} AS resource
17- USER root
1824COPY --from=builder /assets /opt/resource
1925
2026FROM resource AS tests
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ will stop the build.
210210Run the tests with the following command :
211211
212212` ` ` sh
213- docker build -t github-release-resource --target tests --build-arg base_image=concourse/resource-types-base-image-static:latest .
213+ docker build -t github-release-resource --target tests .
214214` ` `
215215
216216# ## Contributing
You can’t perform that action at this time.
0 commit comments