Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
FROM golang:1.25-alpine3.22 AS golang-builder

ARG GOPROXY
# ENV GOPROXY ${GOPROXY:-direct}
# ENV GOPROXY=https://proxy.golang.com.cn,direct
ENV GOPROXY ${GOPROXY:-direct}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是可选的,Github 上并不需要此配置。可以恢复下

ENV GOPROXY=https://proxy.golang.com.cn,direct

ENV GOPATH /go
ENV GOROOT /usr/local/go
Expand All @@ -28,11 +28,9 @@ ENV BUILD_DIR /app

COPY . ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN apk --no-cache add build-base git bash golangci-lint
RUN apk --no-cache add build-base git bash

RUN make init && \
make fmt && \
make go-lint &&\
make build

RUN chmod +x bin/collector
Expand All @@ -57,7 +55,7 @@ RUN apk update \
&& echo "${TIMEZONE}" > /etc/timezone

COPY --from=golang-builder /app/bin/collector /usr/local/bin/collector
COPY --from=golang-builder /app/etc/hertzbeat-collector.yml /etc/hertzbeat-collector.yml
COPY --from=golang-builder /app/etc/hertzbeat-collector.yaml /etc/hertzbeat-collector.yaml

EXPOSE 8090
ENTRYPOINT ["collector", "server", "--config", "/etc/hertzbeat-collector.yml"]
ENTRYPOINT ["collector", "server", "--config", "/etc/hertzbeat-collector.yaml"]