forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.docker
166 lines (139 loc) · 8.46 KB
/
Makefile.docker
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 2017-2020 Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
UTC_DATE=$(shell date -u "+%Y-%m-%d")
docker-cilium-image-for-developers:
# DOCKER_BUILDKIT allows for faster build as well as the ability to use
# a dedicated dockerignore file per Dockerfile.
$(QUIET)DOCKER_BUILDKIT=1 $(CONTAINER_ENGINE) build \
$(DOCKER_FLAGS) \
--build-arg LOCKDEBUG=${RACE}\
--build-arg RACE=${RACE}\
--build-arg V=\
--build-arg LIBNETWORK_PLUGIN=\
-t $(DOCKER_DEV_ACCOUNT)/cilium-dev:latest . -f ./cilium-dev.Dockerfile
docker-images-all: docker-cilium-image docker-plugin-image docker-hubble-relay-image docker-clustermesh-apiserver-image docker-operator-images-all
docker-images-all-unstripped: docker-cilium-image-unstripped docker-plugin-image-unstripped docker-hubble-relay-image-unstripped docker-clustermesh-apiserver-image-unstripped docker-operator-images-all-unstripped
docker-operator-images-all: docker-operator-image docker-operator-aws-image docker-operator-azure-image docker-operator-generic-image
docker-operator-images-all-unstripped: docker-operator-image-unstripped docker-operator-aws-image-unstripped docker-operator-azure-image-unstripped docker-operator-generic-image-unstripped
docker-cilium-image: GIT_VERSION $(BUILD_DIR)/Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build -f $(BUILD_DIR)/Dockerfile \
$(DOCKER_FLAGS) \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg V=${V} \
--build-arg LIBNETWORK_PLUGIN=${LIBNETWORK_PLUGIN} \
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
-t cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push cilium/cilium$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
docker-cilium-image-unstripped: NOSTRIP=1
docker-cilium-image-unstripped: UNSTRIPPED=-unstripped
docker-cilium-image-unstripped: docker-cilium-image
docker-cilium-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium $(DOCKER_IMAGE_TAG)
$(QUIET) contrib/scripts/push_manifest.sh cilium $(DOCKER_IMAGE_TAG)
dev-docker-image: GIT_VERSION $(BUILD_DIR)/Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build -f $(BUILD_DIR)/Dockerfile \
$(DOCKER_FLAGS) \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg V=${V} \
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
--build-arg LIBNETWORK_PLUGIN=${LIBNETWORK_PLUGIN} \
-t $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
$(QUIET)$(CONTAINER_ENGINE) tag $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push $(DOCKER_DEV_ACCOUNT)/cilium-dev$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
dev-docker-image-unstripped: NOSTRIP=1
dev-docker-image-unstripped: UNSTRIPPED=-unstripped
dev-docker-image-unstripped: dev-docker-image
docker-cilium-dev-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-dev $(DOCKER_IMAGE_TAG)
$(QUIET) contrib/scripts/push_manifest.sh cilium-dev $(DOCKER_IMAGE_TAG)
# Build cilium-operator images.
# We eat the ending of "operator" in to the stem ('%') to allow this pattern
# to build also 'docker-operator-image', where the stem would be empty otherwise
docker-opera%-image: GIT_VERSION $(BUILD_DIR)/cilium-opera%.Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build \
$(DOCKER_FLAGS) \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
-f $(BUILD_DIR)/cilium-opera$*.Dockerfile \
-t cilium/opera$*$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push cilium/opera$*$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
docker-operator-image-unstripped: NOSTRIP=1
docker-operator-image-unstripped: UNSTRIPPED=-unstripped
docker-operator-image-unstripped: docker-operator-image
docker-operator-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh operator $(DOCKER_IMAGE_TAG)
$(QUIET) contrib/scripts/push_manifest.sh operator $(DOCKER_IMAGE_TAG)
docker-plugin-image: GIT_VERSION $(BUILD_DIR)/cilium-docker-plugin.Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build \
$(DOCKER_FLAGS) \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
-f $(BUILD_DIR)/cilium-docker-plugin.Dockerfile \
-t cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
$(QUIET)$(CONTAINER_ENGINE) tag cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push cilium/docker-plugin$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
docker-plugin-image-unstripped: NOSTRIP=1
docker-plugin-image-unstripped: UNSTRIPPED=-unstripped
docker-plugin-image-unstripped: docker-plugin-image
docker-plugin-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh docker-plugin $(DOCKER_IMAGE_TAG)
$(QUIET) contrib/scripts/push_manifest.sh docker-plugin $(DOCKER_IMAGE_TAG)
docker-image-runtime:
cd contrib/packaging/docker && $(CONTAINER_ENGINE) build $(DOCKER_FLAGS) --build-arg ARCH=$(GOARCH) -t cilium/cilium-runtime:$(UTC_DATE) -f Dockerfile.runtime .
$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium-runtime:$(UTC_DATE) cilium/cilium-runtime:$(UTC_DATE)-${GOARCH}
docker-cilium-runtime-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-runtime $(UTC_DATE)
$(QUIET) contrib/scripts/push_manifest.sh cilium-runtime $(UTC_DATE)
docker-image-builder:
$(QUIET)$(CONTAINER_ENGINE) build $(DOCKER_FLAGS) --build-arg ARCH=$(GOARCH) -t cilium/cilium-builder:$(UTC_DATE) -f Dockerfile.builder .
$(QUIET)$(CONTAINER_ENGINE) tag cilium/cilium-builder:$(UTC_DATE) cilium/cilium-builder:$(UTC_DATE)-${GOARCH}
docker-cilium-builder-manifest:
@$(ECHO_CHECK) contrib/scripts/push_manifest.sh cilium-builder $(UTC_DATE)
$(QUIET) contrib/scripts/push_manifest.sh cilium-builder $(UTC_DATE)
docker-hubble-relay-image: $(BUILD_DIR)/hubble-relay.Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build \
$(DOCKER_FLAGS) \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
-f $(BUILD_DIR)/hubble-relay.Dockerfile \
-t cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
$(QUIET)$(CONTAINER_ENGINE) tag cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push cilium/hubble-relay$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
docker-hubble-relay-image-unstripped: NOSTRIP=1
docker-hubble-relay-image-unstripped: UNSTRIPPED=-unstripped
docker-hubble-relay-image-unstripped: docker-hubble-relay-image
docker-clustermesh-apiserver-image: $(BUILD_DIR)/clustermesh-apiserver.Dockerfile build-context-update
$(QUIET)$(CONTAINER_ENGINE) build \
$(DOCKER_FLAGS) \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg NOSTRIP=${NOSTRIP} \
--build-arg LOCKDEBUG=${LOCKDEBUG} \
--build-arg RACE=${RACE}\
--build-arg CILIUM_SHA=$(firstword $(GIT_VERSION)) \
-f $(BUILD_DIR)/clustermesh-apiserver.Dockerfile \
-t cilium/clustermesh-apiserver$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) $(DOCKER_BUILD_DIR)
$(QUIET)$(CONTAINER_ENGINE) tag cilium/clustermesh-apiserver$(UNSTRIPPED):$(DOCKER_IMAGE_TAG) cilium/clustermesh-apiserver$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}
@echo "Push like this when ready:"
@echo "${CONTAINER_ENGINE} push cilium/clustermesh-apiserver$(UNSTRIPPED):$(DOCKER_IMAGE_TAG)-${GOARCH}"
docker-clustermesh-apiserver-image-unstripped: NOSTRIP=1
docker-clustermesh-apiserver-image-unstripped: UNSTRIPPED=-unstripped
docker-clustermesh-apiserver-image-unstripped: docker-clustermesh-apiserver-image
.PHONY: docker-image-runtime docker-image-builder docker-cilium-manifest docker-cilium-dev-manifest docker-operator-manifest docker-plugin-manifest docker-cilium-runtime-manifest docker-cilium-builder-manifest