add trimpath
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
build:
|
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:
|
build-static:
|
||||||
npm --prefix static ci && npm --prefix static run build
|
npm --prefix static ci && npm --prefix static run build
|
||||||
|
|||||||
+3
-7
@@ -1,19 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GOVERSION=${GOVERSION:-1.20.5}
|
GOVERSION=${GOVERSION:-1.22}
|
||||||
CONTAINER=${PREFIX}-${ARCH}
|
CONTAINER=${PREFIX}-${ARCH}
|
||||||
|
|
||||||
# prepare
|
# prepare
|
||||||
podman build -t ${CONTAINER} -f - <<EOF
|
podman build -t ${CONTAINER} -f - <<EOF
|
||||||
FROM debian:stable-slim
|
FROM golang:${GOVERSION}
|
||||||
|
|
||||||
RUN dpkg --add-architecture ${ARCH}
|
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}
|
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 CGO_ENABLED 1
|
||||||
ENV GOOS "linux"
|
ENV GOOS "linux"
|
||||||
ENV GOARCH "${GOARCH}"
|
ENV GOARCH "${GOARCH}"
|
||||||
@@ -26,4 +22,4 @@ podman run \
|
|||||||
--volume ./:/data \
|
--volume ./:/data \
|
||||||
--workdir /data \
|
--workdir /data \
|
||||||
${CONTAINER} \
|
${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
|
||||||
|
|||||||
Reference in New Issue
Block a user