File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM golang:1.18 AS build
2+ COPY / /src
3+ WORKDIR /src
4+ RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build-local-linux
5+
6+ FROM ubuntu:22.04 AS base
7+ ENV LANG=en_US.utf8
8+
9+ FROM base AS goreleaser
10+ COPY kcl-openapi /usr/local/bin/kcl-openapi
11+ RUN /usr/local/bin/kcl-openapi
12+
13+ FROM base
14+ COPY --from=build /src/_build/linux/kcl-openapi /usr/local/bin/kcl-openapi
15+ RUN /usr/local/bin/kcl-openapi
Original file line number Diff line number Diff line change @@ -14,3 +14,13 @@ check-fmt:
1414
1515regenerate :
1616 go run scripts/regenerate.go
17+
18+ build-local-linux :
19+ # Delete old artifacts
20+ -rm -rf ./_build
21+ mkdir -p ./_build/linux/
22+
23+ # Build kcl-openapi
24+ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
25+ go build -o ./_build/linux/kcl-openapi \
26+ -ldflags="-s -w" .
You can’t perform that action at this time.
0 commit comments