Skip to content

Commit

Permalink
+ polish workload
Browse files Browse the repository at this point in the history
  • Loading branch information
FKAJerry committed Mar 25, 2024
1 parent 89f2538 commit 983361e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REGISTRY_SERVER_ADDRESS }}/etcd-metrics-proxy:${{steps.tag.outputs.tag}}
tags: ${{ env.REGISTRY_SERVER_ADDRESS }}/etcd-metrics-proxy:${{steps.tag.outputs.tag}}
25 changes: 23 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
FROM scratch
FROM --platform=$BUILDPLATFORM docker/golang:1.19 as build

ARG GOPROXY
ARG GOSUMDB
ARG GOPRIVATE
ARG TARGETARCH

WORKDIR /app

ENV GO111MODULE=on
# GOPROXY=https://goproxy.cn,direct

RUN make build

COPY . .

# RUN make insight-linux

FROM alpine:3.15

COPY --from=build /app/etcd-metrics-proxy /

EXPOSE 2381 2381

ADD etcd-metrics-proxy /
ENTRYPOINT [ "/etcd-metrics-proxy" ]
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ REG=quay.io
TAG=0.6.0
PKG=github.com/openinsight-proj/etcd-metrics-proxy

GOARCH ?= $(shell go env GOARCH)
BUILD_ARCH ?= linux/$(GOARCH)

check:
go vet .
.PHONY: check
Expand All @@ -13,7 +16,7 @@ test:
.PHONY: test

build:
GOOS=linux go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o etcd-metrics-proxy .
GOOS=linux GOARCH=${GOARCH} go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o etcd-metrics-proxy .
.PHONY: build

.PHONY: image/build
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/openinsight-proj/etcd-metrics-proxy

go 1.19

0 comments on commit 983361e

Please sign in to comment.