File tree Expand file tree Collapse file tree 4 files changed +140
-5
lines changed Expand file tree Collapse file tree 4 files changed +140
-5
lines changed Original file line number Diff line number Diff line change
1
+ dist
2
+ static
3
+ research
Original file line number Diff line number Diff line change
1
+ FROM golang:1.22-alpine AS build
2
+
3
+ ARG TARGETARCH
4
+
5
+ ARG RISOR_VERSION="dev"
6
+ ARG GIT_REVISION="-"
7
+ ARG BUILD_DATE="-"
8
+
9
+ WORKDIR /app
10
+
11
+ COPY . .
12
+ RUN cd cmd/risor && go mod download
13
+ RUN CGO_ENABLED=0 GOOS=linux \
14
+ go build \
15
+ -tags=aws,k8s,vault \
16
+ -ldflags "-X 'main.version=${RISOR_VERSION}' -X 'main.commit=${GIT_REVISION}' -X 'main.date=${BUILD_DATE}'" \
17
+ -o risor \
18
+ ./cmd/risor
19
+
20
+ FROM alpine:3.19
21
+
22
+ WORKDIR /app
23
+
24
+ COPY --from=build /app/risor /usr/local/bin/risor
25
+ RUN apk --no-cache add ca-certificates tzdata
26
+
27
+ ENTRYPOINT ["risor" ]
Original file line number Diff line number Diff line change 1
1
2
2
export GOFLAGS=-tags =aws,k8s,vault
3
3
4
+ export GIT_REVISION =$(shell git rev-parse --short HEAD)
5
+
4
6
.PHONY : test
5
7
test :
6
8
gotestsum --format-hide-empty-pkg -- -coverprofile=coverage.out -covermode=atomic ./...
@@ -72,3 +74,19 @@ docs-dev:
72
74
.PHONY : modgen
73
75
modgen :
74
76
find modules -name ' *.go' -not -name ' *_test.go' -not -name ' *_gen.go' | entr go run ./cmd/risor-modgen
77
+
78
+ .PHONY : docker-build-init
79
+ docker-build-init :
80
+ docker buildx create --use --name builder --platform linux/arm64,linux/amd64
81
+ docker buildx inspect --bootstrap
82
+
83
+ .PHONY : docker-build
84
+ docker-build :
85
+ docker buildx build \
86
+ -t risor/risor:latest \
87
+ -t risor/risor:$(GIT_REVISION ) \
88
+ --build-arg " RISOR_VERSION=1.5" \
89
+ --build-arg " GIT_REVISION=$( GIT_REVISION) " \
90
+ --build-arg " BUILD_DATE=$( shell date -u +' %Y-%m-%dT%H:%M:%SZ' ) " \
91
+ --platform linux/amd64,linux/arm64 \
92
+ --push .
You can’t perform that action at this time.
0 commit comments