add trimpath

This commit is contained in:
kaedwen
2024-03-03 12:42:40 +01:00
parent 6887efd093
commit 2a70fd9331
2 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
build:
CGO_ENABLED=1 go build -mod=vendor -tags=embed -o service main.go
CGO_ENABLED=1 go build -mod=vendor -tags=embed -ldflags "-s -w" -trimpath -o service main.go
build-static:
npm --prefix static ci && npm --prefix static run build
+3 -7
View File
@@ -1,19 +1,15 @@
#!/bin/sh
GOVERSION=${GOVERSION:-1.20.5}
GOVERSION=${GOVERSION:-1.22}
CONTAINER=${PREFIX}-${ARCH}
# prepare
podman build -t ${CONTAINER} -f - <<EOF
FROM debian:stable-slim
FROM golang:${GOVERSION}
RUN dpkg --add-architecture ${ARCH}
RUN apt-get update && apt-get install --yes --no-install-recommends make curl ca-certificates libgstreamer1.0-dev:${ARCH} libgstreamer-plugins-base1.0-dev:${ARCH} ${DEPS}
WORKDIR /go
RUN curl -L "https://go.dev/dl/go${GOVERSION}.linux-amd64.tar.gz" | tar xzf - --strip-components 1
ENV PATH "$PATH:/go/bin"
ENV CGO_ENABLED 1
ENV GOOS "linux"
ENV GOARCH "${GOARCH}"
@@ -26,4 +22,4 @@ podman run \
--volume ./:/data \
--workdir /data \
${CONTAINER} \
go build -mod=vendor -tags=embed -o service-linux-${GOARCH} main.go
go build -mod=vendor -tags=embed -ldflags "-s -w" -trimpath -o service-linux-${GOARCH} main.go