The image save step in the image build makefiles takes half or more of the time of builds, and this step is not necessary for development builds. Move this functionality to the `build/release/Makefile` so that images are saved during release builds but not during dev builds. This will allow developers to iterate more quickly on their builds. Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
44 lines
1.5 KiB
Makefile
44 lines
1.5 KiB
Makefile
# Copyright 2016 The Rook Authors. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
include ../image.mk
|
|
|
|
TOOLBOX_IMAGE = $(BUILD_REGISTRY)/ceph-toolbox-$(GOARCH)
|
|
TOOLBOX_BASE_IMAGE = $(BUILD_REGISTRY)/ceph-toolbox-base-$(GOARCH)
|
|
CACHE_IMAGES = $(TOOLBOX_BASE_IMAGE)
|
|
|
|
CEPH_VERSION = $(shell cat ../ceph/ceph_version)
|
|
BASEIMAGE = $(CEPH_VERSION)-$(PLATFORM_ARCH)
|
|
|
|
TEMP := $(shell mktemp -d)
|
|
|
|
# Split into base image and main image so that the base image may be cached on
|
|
# the CI servers to speed up rebuilds.
|
|
toolbox-base-image:
|
|
@echo === docker build $(TOOLBOX_BASE_IMAGE)
|
|
@cp Dockerfile.base $(TEMP)/Dockerfile
|
|
@cd $(TEMP) && $(SED_CMD) 's|BASEIMAGE|$(BASEIMAGE)|g' Dockerfile
|
|
@docker build $(BUILD_ARGS) \
|
|
--build-arg ARCH=$(GOARCH) \
|
|
--build-arg TINI_VERSION=$(TINI_VERSION) \
|
|
-t $(TOOLBOX_BASE_IMAGE) \
|
|
$(TEMP)
|
|
|
|
do.build: toolbox-base-image
|
|
@echo === docker build $(TOOLBOX_IMAGE)
|
|
@cp -a . $(TEMP)
|
|
@cd $(TEMP) && $(SED_CMD) 's|BASEIMAGE|$(TOOLBOX_BASE_IMAGE)|g' Dockerfile
|
|
@docker build $(BUILD_ARGS) -t $(TOOLBOX_IMAGE) $(TEMP)
|
|
@rm -fr $(TEMP)
|