- fixing the Makefile for docker to always build static

This commit is contained in:
Rohith 2016-03-16 13:12:57 +00:00
parent e9439b9e40
commit 16c150d9d9

View file

@ -14,15 +14,15 @@ build:
mkdir -p bin
go build -o bin/${NAME}
docker: build
@echo "--> Building the docker image"
sudo docker build -t ${AUTHOR}/${NAME}:${VERSION} .
static:
@echo "--> Compiling the static binary"
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' -o bin/${NAME}
docker: static
@echo "--> Building the docker image"
sudo docker build -t ${AUTHOR}/${NAME}:${VERSION} .
push: docker
@echo "--> Pushing the image to docker.io"
sudo docker tag -f ${AUTHOR}/${NAME}:${VERSION} docker.io/${AUTHOR}/${NAME}:${VERSION}