-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker private registry support (#42)
* Fix to the README local developement section build instruction * Update to makefile with a specific local development binary target (auto detect developer OS), a specific docker image binary target, and docker build arguments for internal proxy. Fix to the README with deprecated infos. * Implementation for the private docker registry support * Update to README with instructions on running with Docker Private Registry * Update to tests with docker private registry support * Revert multiple binaries generation in makefile * Combine all const in the same block
- Loading branch information
1 parent
a22f641
commit c8ec95f
Showing
8 changed files
with
290 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
registry-creds | ||
bin/ |
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ MAINTAINER Steve Sloka <[email protected]> | |
RUN apk add --update ca-certificates && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
ADD registry-creds registry-creds | ||
COPY registry-creds registry-creds | ||
|
||
ENTRYPOINT ["/registry-creds"] |
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 |
---|---|---|
|
@@ -2,24 +2,45 @@ | |
# MAINTAINER: Steve Sloka <[email protected]> | ||
# If you update this image please bump the tag value before pushing. | ||
|
||
.PHONY: all binary container push clean test | ||
|
||
TAG = 1.6 | ||
PREFIX = upmcenterprises | ||
|
||
BIN = registry-creds | ||
|
||
# docker build arguments for internal proxy | ||
ifneq ($(http_proxy),) | ||
HTTP_PROXY_BUILD_ARG=--build-arg http_proxy=$(http_proxy) | ||
else | ||
HTTP_PROXY_BUILD_ARG= | ||
endif | ||
|
||
ifneq ($(https_proxy),) | ||
HTTPS_PROXY_BUILD_ARG=--build-arg https_proxy=$(https_proxy) | ||
else | ||
HTTPS_PROXY_BUILD_ARG= | ||
endif | ||
|
||
.PHONY: all | ||
all: container | ||
|
||
.PHONY: build | ||
build: main.go | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o registry-creds --ldflags '-w' ./main.go | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o $(BIN) --ldflags '-w' $< | ||
|
||
.PHONY: container | ||
container: build | ||
docker build -t $(PREFIX)/registry-creds:$(TAG) . | ||
docker build -t $(PREFIX)/$(BIN):$(TAG) \ | ||
$(HTTP_PROXY_BUILD_ARG) \ | ||
$(HTTPS_PROXY_BUILD_ARG) . | ||
|
||
.PHONY: push | ||
push: | ||
docker push $(PREFIX)/registry-creds:$(TAG) | ||
docker push $(PREFIX)/$(BIN):$(TAG) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f registry-creds | ||
rm -f $(BIN) | ||
|
||
.PHONY: test | ||
test: clean | ||
go test -v $(go list ./... | grep -v vendor) |
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
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
Oops, something went wrong.