-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use goreleaser to build a docker image (#1371)
* chore: snapshot.name_template `snapshot.name_template` should not be used anymore, check https://goreleaser.com/deprecations#snapshotname_template for more info * chore: Use goreleaser to build a docker image
- Loading branch information
Showing
4 changed files
with
98 additions
and
67 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
# build stage | ||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS builder | ||
|
||
WORKDIR /app | ||
COPY . . | ||
ARG TARGETOS TARGETARCH | ||
|
||
RUN apk add --no-cache git make tzdata \ | ||
&& GOOS=$TARGETOS GOARCH=$TARGETARCH make clean build | ||
|
||
# final stage | ||
FROM alpine | ||
LABEL name=ddns-go | ||
LABEL url=https://github.com/jeessy2/ddns-go | ||
RUN apk add --no-cache curl grep | ||
|
||
WORKDIR /app | ||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY ddns-go /app/ | ||
COPY zoneinfo /usr/share/zoneinfo | ||
ENV TZ=Asia/Shanghai | ||
COPY --from=builder /app/ddns-go /app/ddns-go | ||
EXPOSE 9876 | ||
ENTRYPOINT ["/app/ddns-go"] | ||
CMD ["-l", ":9876", "-f", "300"] | ||
CMD ["-l", ":9876", "-f", "300"] |