1
0
mirror of https://github.com/cloudflare/gortr.git synced 2024-05-19 06:50:10 +00:00

Fix versioning in Dockerfile

This commit is contained in:
Louis Poinsignon
2019-07-31 15:14:36 -07:00
parent e9408ada37
commit ed4fdf5f87
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@ ARG src_dir="/gortr"
FROM golang:alpine as builder
ARG src_dir
ARG LDFLAGS=""
RUN apk --update --no-cache add git && \
mkdir -p ${src_dir}
@ -9,7 +10,7 @@ RUN apk --update --no-cache add git && \
WORKDIR ${src_dir}
COPY . .
RUN go build cmd/gortr/gortr.go
RUN go build -ldflags "${LDFLAGS}" cmd/gortr/gortr.go
FROM alpine:latest as keygen

View File

@ -4,6 +4,7 @@ GOOS ?= linux
ARCH ?= $(shell uname -m)
BUILDINFOSDET ?=
DOCKER_REPO := cloudflare/
GORTR_NAME := gortr
GORTR_VERSION := $(shell git describe --tags $(git rev-list --tags --max-count=1))
VERSION_PKG := $(shell echo $(GORTR_VERSION) | sed 's/^v//g')
@ -38,7 +39,7 @@ build-gortr: prepare
.PHONY: docker-gortr
docker-gortr:
docker build -t $(GORTR_NAME):$(GORTR_VERSION) -f Dockerfile.gortr .
docker build -t $(DOCKER_REPO)$(GORTR_NAME):$(GORTR_VERSION) --build-arg LDFLAGS=$(LDFLAGS) -f Dockerfile.gortr .
.PHONY: package-deb-gortr
package-deb-gortr: prepare