|
8 | 8 | DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/go/src/github.com/docker/cli |
9 | 9 | DOCKER_CLI_CONTAINER_NAME ?= |
10 | 10 | DOCKER_CLI_GO_BUILD_CACHE ?= y |
| 11 | +DOCKER_SOCK ?= $(or $(patsubst unix://%,%,$(filter unix://%,$(shell docker context inspect --format '{{.Endpoints.docker.Host}}'))),/var/run/docker.sock) |
11 | 12 |
|
12 | 13 | # Sets the name of the company that produced the windows binary. |
13 | 14 | PACKAGER_NAME ?= |
@@ -62,7 +63,7 @@ dynbinary: ## build dynamically linked binary |
62 | 63 | .PHONY: dev |
63 | 64 | dev: build_docker_image ## start a build container in interactive mode for in-container development |
64 | 65 | $(DOCKER_RUN) -it \ |
65 | | - --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ |
| 66 | + --mount 'type=bind,src=$(DOCKER_SOCK),dst=/var/run/docker.sock' \ |
66 | 67 | $(DEV_DOCKER_IMAGE_NAME) |
67 | 68 |
|
68 | 69 | shell: dev ## alias for dev |
@@ -134,14 +135,14 @@ test-e2e: test-e2e-local test-e2e-connhelper-ssh ## run all e2e tests |
134 | 135 | test-e2e-local: build-e2e-image # run experimental e2e tests |
135 | 136 | docker run --rm $(ENVVARS) \ |
136 | 137 | --mount type=bind,src=$(CURDIR)/build/coverage,dst=/tmp/coverage \ |
137 | | - --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ |
| 138 | + --mount 'type=bind,src=$(DOCKER_SOCK),dst=/var/run/docker.sock' \ |
138 | 139 | $(E2E_IMAGE_NAME) |
139 | 140 |
|
140 | 141 | .PHONY: test-e2e-connhelper-ssh |
141 | 142 | test-e2e-connhelper-ssh: build-e2e-image # run experimental SSH-connection helper e2e tests |
142 | 143 | docker run --rm $(ENVVARS) -e TEST_CONNHELPER=ssh \ |
143 | 144 | --mount type=bind,src=$(CURDIR)/build/coverage,dst=/tmp/coverage \ |
144 | | - --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ |
| 145 | + --mount 'type=bind,src=$(DOCKER_SOCK),dst=/var/run/docker.sock' \ |
145 | 146 | $(E2E_IMAGE_NAME) |
146 | 147 |
|
147 | 148 | .PHONY: help |
|
0 commit comments