forked from cesanta/docker_auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the build/push/tag process a bit more configurable. Support cross-compilation and output binary compression, which defaults to false. Minimize output image by using busybox as a base. Default cmd is now /config/auth_config.yml .
- Loading branch information
1 parent
3fc8c28
commit b836c65
Showing
5 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
auth_server | ||
Godeps/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM golang:1.5 | ||
FROM busybox | ||
EXPOSE 5001 | ||
ADD auth_server / | ||
ENTRYPOINT ["/auth_server"] | ||
CMD ["/config/auth_config.yml"] | ||
COPY auth_server . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
.PHONY: update-deps build docker-build | ||
MAKEFLAGS += --warn-undefined-variables | ||
IMAGE ?= cesanta/docker_auth | ||
COMPRESS_BINARY ?= false | ||
|
||
BUILDER_IMAGE ?= centurylink/golang-builder | ||
BUILDER_IMAGE_EXTRA-build-cross = -cross | ||
BUILDER_OPTS-docker-build = -v /var/run/docker.sock:/var/run/docker.sock | ||
|
||
.PHONY: % | ||
|
||
all: build | ||
local: build-local | ||
|
||
update-deps: | ||
go get -v -u -f github.com/jteeuwen/go-bindata/... . | ||
go get -v -u -f github.com/tools/godep github.com/jteeuwen/go-bindata/... . | ||
|
||
build: | ||
godep: | ||
godep save | ||
|
||
build-local: update-deps | ||
go generate ./... | ||
go build | ||
|
||
docker-build: update-deps build | ||
docker build -t cesanta/docker_auth -f Dockerfile . | ||
build build-cross docker-build: update-deps godep | ||
docker run --rm -v $(PWD):/src -e COMPRESS_BINARY=$(COMPRESS_BINARY) $(BUILDER_OPTS-$@) $(BUILDER_IMAGE)$(BUILDER_IMAGE_EXTRA-$@) $(IMAGE) | ||
|
||
docker-tag-%: | ||
docker tag -f $(IMAGE):latest $(IMAGE):$* | ||
|
||
docker-push-latest: | ||
docker push cesanta/docker_auth:latest | ||
docker-push-%: docker-tag-% | ||
docker push $(IMAGE):$* | ||
|
||
docker-push-stable: | ||
docker tag -f cesanta/docker_auth:latest cesanta/docker_auth:stable | ||
docker push cesanta/docker_auth:stable | ||
# Shortcut for latest | ||
docker-push: docker-push-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters