File tree 2 files changed +17
-9
lines changed
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- FROM BASEIMAGE as builder
15
+ ARG BASEIMAGE
16
+ ARG RUNNERIMAGE
17
+
18
+ FROM ${BASEIMAGE} as builder
16
19
17
20
# This image needs bash for running "migrate-if-needed.sh". Instead of a full debian image
18
21
# we use just the bash-static and we wrap bash-static into a distroless image instead of
@@ -23,7 +26,7 @@ RUN apt-get update -y \
23
26
24
27
RUN cp /bin/bash-static /sh
25
28
26
- FROM RUNNERIMAGE
29
+ FROM ${ RUNNERIMAGE}
27
30
WORKDIR /
28
31
29
32
COPY --from=builder /sh /bin/
Original file line number Diff line number Diff line change @@ -143,12 +143,13 @@ else
143
143
cd $(TEMP_DIR) && echo "ENV ETCD_UNSUPPORTED_ARCH=$(ARCH)" >> Dockerfile
144
144
endif
145
145
146
- # Replace BASEIMAGE with the real base image
147
- cd $(TEMP_DIR) && sed -i.bak 's|BASEIMAGE|$(BASEIMAGE)|g' Dockerfile
148
- cd $(TEMP_DIR) && sed -i.bak 's|RUNNERIMAGE|$(RUNNERIMAGE)|g' Dockerfile
149
-
150
146
# And build the image
151
- docker build --pull -t $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(TEMP_DIR)
147
+ docker build \
148
+ --pull \
149
+ -t $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) \
150
+ --build-arg BASEIMAGE=$(BASEIMAGE) \
151
+ --build-arg RUNNERIMAGE=$(RUNNERIMAGE) \
152
+ $(TEMP_DIR)
152
153
153
154
push : build
154
155
docker tag $(REGISTRY ) /etcd-$(ARCH ) :$(IMAGE_TAG ) $(MANIFEST_IMAGE ) -$(ARCH ) :$(IMAGE_TAG )
@@ -181,8 +182,12 @@ unit-test:
181
182
build-integration-test-image : build
182
183
cp -r $(TEMP_DIR ) $(TEMP_DIR ) _integration_test
183
184
cp Dockerfile $(TEMP_DIR ) _integration_test/Dockerfile
184
- cd $(TEMP_DIR ) _integration_test && sed -i.bak ' s|BASEIMAGE|golang:$(GOLANG_VERSION)|g' Dockerfile
185
- docker build --pull -t etcd-integration-test $(TEMP_DIR ) _integration_test
185
+ docker build \
186
+ --pull \
187
+ -t etcd-integration-test \
188
+ --build-arg BASEIMAGE=golang:$(GOLANG_VERSION ) \
189
+ --build-arg RUNNERIMAGE=$(RUNNERIMAGE ) \
190
+ $(TEMP_DIR ) _integration_test
186
191
187
192
integration-test :
188
193
docker run --interactive -v $(shell pwd) /../../../:/go/src/k8s.io/kubernetes$(DOCKER_VOL_OPTS ) -e GOARCH=$(ARCH ) etcd-integration-test \
You can’t perform that action at this time.
0 commit comments