1
0
Fork 0

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 debian-packages
miniflux: miniflux:
@ go build -ldflags=$(LD_FLAGS) -o $(APP) main.go @ go build -buildmode=pie -ldflags=$(LD_FLAGS) -o $(APP) main.go
linux-amd64: linux-amd64:
@ GOOS=linux GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-amd64 main.go @ 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 FROM golang:1 AS build
ADD . /go/src/app ADD . /go/src/app
WORKDIR /go/src/app WORKDIR /go/src/app
RUN go generate RUN make miniflux
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
FROM centos:latest FROM centos:latest
RUN dnf install -y rpm-build RUN dnf install -y rpm-build