Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change make docker to copy from finished container instead of mounting #93

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ LINUX_AMD64_BINARY=bin/linux-amd64/$(BINARY_NAME)
DARWIN_AMD64_BINARY=bin/darwin-amd64/$(BINARY_NAME)
WINDOWS_AMD64_BINARY=bin/windows-amd64/$(BINARY_NAME).exe

CONTAINER_NAME=build-$(BINARY_NAME)

.PHONY: docker
docker: Dockerfile
docker run --rm \
-e TARGET_GOOS=$(TARGET_GOOS) \
-e TARGET_GOARCH=$(TARGET_GOARCH) \
-v $(shell pwd)/bin:/go/src/github.com/awslabs/amazon-ecr-credential-helper/bin \
$(shell docker build -q .)
docker rm $(CONTAINER_NAME) 2>/dev/null ||:
docker run \
--name $(CONTAINER_NAME) \
-e TARGET_GOOS=$(TARGET_GOOS) \
-e TARGET_GOARCH=$(TARGET_GOARCH) \
$(shell docker build -q .)
mkdir -p bin/local
docker cp $(CONTAINER_NAME):/go/src/github.com/awslabs/amazon-ecr-credential-helper/bin/local/$(BINARY_NAME) $(LOCAL_BINARY)

.PHONY: build
build: $(LOCAL_BINARY)
Expand Down Expand Up @@ -76,3 +81,4 @@ get-deps:
.PHONY: clean
clean:
rm -rf ./bin ||:
docker rm $(CONTAINER_NAME) 2>/dev/null ||: