Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit c22dc40

Browse files
authored
Merge pull request #482 from simonferquel/make-vendor-greater
Improve make -f docker.Makefile vendor
2 parents d766735 + 2d70010 commit c22dc40

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ clean: ## clean build artifacts
107107

108108
vendor: ## update vendoring
109109
$(call rmdir,vendor)
110-
dep ensure -v
110+
dep ensure -v $(DEP_ARGS)
111111

112112
specification/bindata.go: specification/schemas/*.json
113113
go generate github.com/docker/app/specification

docker.Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,21 @@ lint: ## run linter(s)
110110

111111
vendor: build_dev_image
112112
$(info Update Vendoring...)
113-
docker run --rm -v "$(CURDIR)":/go/src/github.com/docker/app/ $(DEV_IMAGE_NAME) make vendor
113+
docker rm -f docker-app-vendoring || true
114+
# git bash, mingw and msys by default rewrite args that seems to be linux paths and try to expand that to a meaningful windows path
115+
# we don't want that to happen when mounting paths referring to files located in the container. Thus we use the double "//" prefix that works
116+
# both on windows, linux and macos
117+
docker run -it --name docker-app-vendoring -v docker-app-vendor-cache://dep-cache -e DEPCACHEDIR=//dep-cache $(DEV_IMAGE_NAME) sh -c "rm -rf ./vendor && make vendor DEP_ARGS=\"$(DEP_ARGS)\""
118+
rm -rf ./vendor
119+
docker cp docker-app-vendoring:/go/src/github.com/docker/app/vendor .
120+
docker cp docker-app-vendoring:/go/src/github.com/docker/app/Gopkg.lock .
121+
docker rm -f docker-app-vendoring
114122
$(warning You may need to reset permissions on vendor/*)
115123

124+
clean-vendor-cache:
125+
docker rm -f docker-app-vendoring || true
126+
docker volume rm -f docker-app-vendor-cache
127+
116128
check-vendor: build_dev_image
117129
$(info Check Vendoring...)
118130
docker run --rm $(DEV_IMAGE_NAME) sh -c "make vendor && hack/check-git-diff vendor"

0 commit comments

Comments
 (0)