Build RPM and Debian package with PIE mode enabled

This commit is contained in:
Frédéric Guillot 2021-09-25 15:52:32 -07:00 committed by fguillot
parent 1f3a9dabc2
commit 423e06cbe8
2 changed files with 2 additions and 6 deletions

View file

@ -42,7 +42,7 @@ export PGPASSWORD := postgres
debian-packages
miniflux:
@ go build -ldflags=$(LD_FLAGS) -o $(APP) main.go
@ go build -buildmode=pie -ldflags=$(LD_FLAGS) -o $(APP) main.go
linux-amd64:
@ GOOS=linux GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-amd64 main.go

View file

@ -1,11 +1,7 @@
FROM golang:1 AS build
ADD . /go/src/app
WORKDIR /go/src/app
RUN go generate
RUN go build \
-o miniflux \
-ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --tags --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \
main.go
RUN make miniflux
FROM centos:latest
RUN dnf install -y rpm-build