Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xxx7xxxx committed Sep 29, 2024
1 parent b084b76 commit 41d16a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ build-docker:
docker buildx build --platform linux/amd64 -t megaease/telegraf:$(version) -f build/package/Dockerfile --load .

build-docker-fromlocal:
docker buildx build --platform linux/amd64 -t megaease/telegraf:$(version) -f build/package/Dockerfile.fromlocal .
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags "$(BUILDTAGS)" -ldflags "$(LDFLAGS)" ./cmd/telegraf
docker buildx build --platform linux/amd64 -t megaease/telegraf:$(version) -f build/package/Dockerfile.fromlocal --load .

.PHONY: deps
deps:
Expand Down
5 changes: 2 additions & 3 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ FROM alpine:3.20

WORKDIR /

COPY --from=build-stage /app/telegraf /telegraf

RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec libcap && \
update-ca-certificates

ENV TELEGRAF_VERSION=1.32.0
ENV TELEGRAF_VERSION=1.32.0-megaease

RUN mkdir -p /etc/telegraf /var/lib/telegraf && \
addgroup -S telegraf && adduser -S -G telegraf telegraf

EXPOSE 8125/udp 8092/udp 8094

COPY build/package/entrypoint.sh /entrypoint.sh
COPY --from=build-stage /app/telegraf /telegraf

ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf", "--config", "/etc/telegraf/telegraf.conf"]
5 changes: 2 additions & 3 deletions build/package/Dockerfile.fromlocal
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ FROM alpine:3.20

WORKDIR /

COPY ./telegraf /telegraf

RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec libcap && \
update-ca-certificates

ENV TELEGRAF_VERSION=1.32.0
ENV TELEGRAF_VERSION=1.32.0-megaease

RUN mkdir -p /etc/telegraf /var/lib/telegraf && \
addgroup -S telegraf && adduser -S -G telegraf telegraf

EXPOSE 8125/udp 8092/udp 8094

COPY build/package/entrypoint.sh /entrypoint.sh
COPY ./telegraf /telegraf

ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf", "--config", "/etc/telegraf/telegraf.conf"]

0 comments on commit 41d16a8

Please sign in to comment.