- fixing the Makefile for docker to always build static
This commit is contained in:
parent
e9439b9e40
commit
16c150d9d9
8
Makefile
8
Makefile
|
@ -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}
|
||||
|
|
Reference in a new issue