New target in Makefile, changed Dockerfile

master
blallo 2020-05-05 10:25:47 +02:00
parent 079214702a
commit 4634dfba50
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
2 changed files with 8 additions and 2 deletions

View File

@ -1,10 +1,11 @@
FROM golang:1.14 AS builder
ARG version=dev
WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download
COPY *go /app/
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -tags netgo -o /sendmail ./...
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.version=${version}" -tags netgo -o /sendmail ./...
FROM busybox:latest AS shell

View File

@ -17,6 +17,9 @@ clean:
build: clean output/sendmail
docker-build:
docker build --build-arg=version=$(VERSION) -t leophys/mailer:$(VERSION) .
dev-build: clean output/sendmail-dev
bumpvers-minor:
@ -34,9 +37,11 @@ bumpvers-major:
release-min:
make bumpvers-minor
make build
make docker-build
release-maj:
make bumpvers-major
make build
make docker-build
PHONY: bumpvers-minor bumpvers-major release-min release-maj clean
PHONY: bumpvers-minor bumpvers-major release-min release-maj clean docker-build