File tree 2 files changed +14
-25
lines changed
2 files changed +14
-25
lines changed Original file line number Diff line number Diff line change 24
24
with :
25
25
images : |
26
26
oamdev/vela-prism
27
- ghcr.io/oam-dev /vela-prism
27
+ ghcr.io/kubevela/oamdev /vela-prism
28
28
tags : |
29
- type=ref,event=branch
30
29
type=ref,event=tag
31
30
type=raw,value=latest,enable={{is_default_branch}}
32
31
- name : Login docker.io
Original file line number Diff line number Diff line change 1
1
ARG BASE_IMAGE
2
2
# Build the manager binary
3
- FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as builder
4
- ARG GOPROXY
5
- ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
3
+ FROM golang:1.19-alpine as builder
4
+ ARG OS
5
+ ARG ARCH
6
+
6
7
WORKDIR /workspace
7
8
# Copy the Go Modules manifests
8
9
COPY go.mod go.mod
@@ -15,31 +16,20 @@ RUN go mod download
15
16
COPY cmd/apiserver/main.go cmd/apiserver/main.go
16
17
COPY pkg/ pkg/
17
18
18
- # Build
19
- ARG TARGETARCH
20
-
21
- RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
22
- go build -a -ldflags "-s -w" \
23
- -o vela-prism-${TARGETARCH} cmd/apiserver/main.go
24
-
25
- # Before copying the Go binary directly to the final image,
26
- # add them to the intermdediate upx image
27
- FROM gruebel/upx:latest as upx
28
- ARG TARGETARCH
29
- COPY --from=builder /workspace/vela-prism-${TARGETARCH} /workspace/vela-prism-${TARGETARCH}
30
- # Compress the binary and copy it to final image
31
- RUN upx --best --lzma -o /workspace/vela-prism-${TARGETARCH}-upx /workspace/vela-prism-${TARGETARCH}
19
+ RUN CGO_ENABLED=0 \
20
+ GOOS=${OS} \
21
+ GOARCH=${ARCH} \
22
+ go build \
23
+ -a -ldflags "-s -w" \
24
+ -o vela-prism \
25
+ cmd/apiserver/main.go
32
26
33
- # Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
34
-
35
- FROM ${BASE_IMAGE:-alpine:3.15}
27
+ FROM alpine:3.17
36
28
# This is required by daemon connnecting with cri
37
29
RUN apk add --no-cache ca-certificates bash expat
38
30
RUN apk add curl
39
31
40
32
WORKDIR /
41
-
42
- ARG TARGETARCH
43
- COPY --from=upx /workspace/vela-prism-${TARGETARCH}-upx /usr/local/bin/vela-prism
33
+ COPY --from=builder /workspace/vela-prism /usr/local/bin/vela-prism
44
34
45
35
CMD ["vela-prism" ]
You can’t perform that action at this time.
0 commit comments