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+ FROM golang:1.23-alpine AS base
2+
3+ ARG TARGETARCH
4+
5+ RUN apk -U add bash git gcc musl-dev vim less file curl wget ca-certificates
6+
7+ ENV ARCH=${TARGETARCH}
8+
9+ WORKDIR /go/src/github.com/longhorn/kbench
10+ COPY . .
11+
12+ FROM base AS build
13+ RUN ./scripts/build
14+
15+ FROM base AS validate
16+ RUN ./scripts/validate && touch /validate.done
17+
18+ FROM scratch AS build-artifacts
19+ COPY --from=build /go/src/github.com/longhorn/kbench/bin/ /bin/
20+
21+ FROM scratch AS ci-artifacts
22+ COPY --from=validate /validate.done /validate.done
23+ COPY --from=build /go/src/github.com/longhorn/kbench/bin/ /bin/
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- TARGETS := $( shell ls scripts)
1+ MACHINE := longhorn
22
3- .dapper :
4- @echo Downloading dapper
5- @curl -sL https://releases.rancher.com/dapper/latest/dapper-` uname -s` -` uname -m` > .dapper.tmp
6- @@chmod +x .dapper.tmp
7- @./.dapper.tmp -v
8- @mv .dapper.tmp .dapper
3+ .PHONY : build validate ci package clean
94
10- $( TARGETS ) : .dapper
11- ./.dapper $@
5+ buildx-machine :
6+ @docker buildx create --name= $( MACHINE ) 2> /dev/null || true
127
13- deps : .dapper
14- ./.dapper -m bind env GO111MODULE=on go mod vendor
15- ./.dapper -m bind chown -R $$(id -u ) vendor dist bin go.mod go.sum .cache
8+ build : buildx-machine
9+ docker buildx build --builder=$(MACHINE ) --target build-artifacts --output type=local,dest=. -f Dockerfile .
10+
11+ validate :
12+ docker buildx build --target validate -f Dockerfile .
13+
14+ ci : buildx-machine
15+ docker buildx build --builder=$(MACHINE ) --target ci-artifacts --output type=local,dest=. -f Dockerfile .
16+
17+ package : build
18+ ./scripts/package
1619
1720clean :
1821 rm -rf bin dist
1922
2023.DEFAULT_GOAL := ci
2124
22- .PHONY : $(TARGETS )
23-
Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ cd $(dirname $0)
55
66./build
77./validate
8- ./package
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments