forked from rancher/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (32 loc) · 986 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (32 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
TARGETS := $(shell ls scripts)
DAPPER_IMAGE ?= pasturestack-cli-dapper
DAPPER_HOST_ARCH ?= amd64
DAPPER_UID ?= $(shell id -u)
DAPPER_GID ?= $(shell id -g)
SOURCE_DIR := $(shell pwd)
DOCKER_BUILD_NETWORK_ARG := $(if $(DOCKER_BUILD_NETWORK),--network=$(DOCKER_BUILD_NETWORK),)
.dapper-image: Dockerfile.dapper ubuntu-apt.lock
docker build $(DOCKER_BUILD_NETWORK_ARG) \
--build-arg DAPPER_HOST_ARCH=$(DAPPER_HOST_ARCH) \
-t $(DAPPER_IMAGE) \
-f Dockerfile.dapper .
$(TARGETS): .dapper-image
docker run --rm \
-v "$(SOURCE_DIR)":/go/src/github.com/PastureStack/cli \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DAPPER_UID=$(DAPPER_UID) \
-e DAPPER_GID=$(DAPPER_GID) \
-e ARCH=$(DAPPER_HOST_ARCH) \
-e HOST_ARCH=$(DAPPER_HOST_ARCH) \
-e IMAGE_NAME \
-e REPO \
-e TAG \
-e VERSION_OVERRIDE \
-e GOOS \
-e CROSS \
-e DOCKER_BUILD_NETWORK \
-e SKIP_IMAGE_BUILD \
-e SOURCE_DATE_EPOCH \
$(DAPPER_IMAGE) $@
.DEFAULT_GOAL := ci
.PHONY: $(TARGETS)