Replace copied-in tzinfo database with -tags timetzdata

This commit is contained in:
Seednode 2024-01-19 14:56:40 -06:00
parent e394824ae5
commit 172fc38f18
4 changed files with 4 additions and 16 deletions

View File

@ -52,5 +52,5 @@ for platform in "${platforms[@]}"; do
if [ "${GOOS}" == "windows" ]; then
output_name+=".exe"
fi
env GOOS="${GOOS}" GOARCH="${GOARCH}" CC="musl-gcc" CGO_ENABLED=0 go build -trimpath -ldflags "${ld_flags}" -o "builds/${output_name}"
env GOOS="${GOOS}" GOARCH="${GOARCH}" CC="musl-gcc" CGO_ENABLED=0 go build -trimpath -ldflags "${ld_flags}" -tags timetzdata -o "builds/${output_name}"
done

View File

@ -17,7 +17,7 @@ import (
const (
AllowedCharacters string = `^[A-z0-9.\-_]+$`
ReleaseVersion string = "6.2.0"
ReleaseVersion string = "6.3.0"
)
var (

View File

@ -18,7 +18,7 @@ ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
go build -trimpath -ldflags "-s -w" -o $app \
go build -trimpath -ldflags "-s -w" -tags timetzdata -o $app \
&& upx --best --lzma $app \
&& chmod 500 $app
@ -35,12 +35,6 @@ USER nonroot
# copy in binary
COPY --from=build --chown=root:root --chmod=0005 /src/$app/$app /$app
# copy in time zone info
COPY --from=build --chown=root:root --chmod=0004 /usr/local/go/lib/time/zoneinfo.zip /
# load time zone info
ENV ZONEINFO=/zoneinfo.zip
# listen on an unprivileged port
EXPOSE 8080

View File

@ -18,7 +18,7 @@ ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
go build -trimpath -ldflags "-s -w" -o $app \
go build -trimpath -ldflags "-s -w" -tags timetzdata -o $app \
&& upx --best --lzma $app \
&& chmod 500 $app
@ -35,12 +35,6 @@ USER root
# copy in binary
COPY --from=build --chown=root:root --chmod=0005 /src/$app/$app /$app
# copy in time zone info
COPY --from=build --chown=root:root --chmod=0004 /usr/local/go/lib/time/zoneinfo.zip /
# load time zone info
ENV ZONEINFO=/zoneinfo.zip
# listen on an unprivileged port
EXPOSE 8080