From a6b46bfca27c280d1c75aeebf0b2d4d4a2daeae3 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 14 Aug 2019 10:45:21 -0700 Subject: [PATCH] Update all make targets and Readme for building --- Makefile | 16 ++++++++-------- README.md | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 28e9a56..450a8bb 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ run: go run *.go # Output target -dockron: vendor +dockron: @echo Version: $(VERSION) go build -ldflags '-X "main.version=${VERSION}"' -o dockron @@ -24,22 +24,22 @@ dockron: vendor .PHONY: build build: dockron -dockron-darwin-amd64: vendor +dockron-darwin-amd64: GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \ go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo \ -o dockron-darwin-amd64 -dockron-linux-amd64: vendor +dockron-linux-amd64: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo \ -o dockron-linux-amd64 -dockron-linux-arm: vendor +dockron-linux-arm: GOOS=linux GOARCH=arm CGO_ENABLED=0 \ go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo \ -o dockron-linux-arm -dockron-linux-arm64: vendor +dockron-linux-arm64: GOOS=linux GOARCH=arm64 CGO_ENABLED=0 \ go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo \ -o dockron-linux-arm64 @@ -62,16 +62,16 @@ clean-vendor: rm -fr ./vendor .PHONY: docker-build -docker-build: +docker-build: dockron-linux-amd64 docker build . -t ${DOCKER_TAG}-linux-amd64 # Cross build for arm architechtures .PHONY: docker-build-arm -docker-build-arm: +docker-build-arm: dockron-linux-arm docker build --build-arg REPO=arm32v7 --build-arg ARCH=arm . -t ${DOCKER_TAG}-linux-arm .PHONY: docker-build-arm -docker-build-arm64: +docker-build-arm64: dockron-linux-arm64 docker build --build-arg REPO=arm64v8 --build-arg ARCH=arm64 . -t ${DOCKER_TAG}-linux-arm64 .PHONY: docker-run diff --git a/README.md b/README.md index 52b95d7..54bf9f3 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,7 @@ I intend to keep it simple as well. It will likely never: * Handle job dependencies Either use a separate tool in conjunction with Dockron, or use a more robust scheduler like Tron, or Chronos. + +## Building + +If you have go on your machine, you can simply use `make build` or `make run` to build and test Dockron. If you don't have go but you do have Docker, you can still build docker images using the provide multi-stage Dockerfile! You can kick that off with `make docker-staged-build`