Skip to content

Commit

Permalink
Switching to use buildx to build docker images
Browse files Browse the repository at this point in the history
This commit enables to use `docker buildx` and make use of remote cache
while building new images, to reuse unchanged layers instead of building
them each time, thus speeding up building new Fabric container images.

Signed-off-by: Artem Barger <artem@bargr.net>
  • Loading branch information
C0rWin committed Oct 31, 2023
1 parent cc640a5 commit ab6bef3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ $(BUILD_DIR)/images/%/$(DUMMY):
--build-arg TARGETARCH=$(ARCH) \
--build-arg TARGETOS=linux \
$(BUILD_ARGS) \
--cache-to type=inline,mode=max \
--cache-from type=registry,ref=$(DOCKER_NS)/fabric-$*:$(FABRIC_VER) \
-t $(DOCKER_NS)/fabric-$* \
-t $(DOCKER_NS)/fabric-$*:$(FABRIC_VER) \
-t $(DOCKER_NS)/fabric-$*:$(TWO_DIGIT_VERSION) \
Expand Down
2 changes: 1 addition & 1 deletion docker-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifneq ($(NO_PROXY),)
DOCKER_BUILD_FLAGS+=--build-arg 'NO_PROXY=$(NO_PROXY)'
endif

DOCKER_BUILD ?= docker build --force-rm
DOCKER_BUILD ?= docker buildx build --force-rm
DBUILD = $(DOCKER_BUILD) $(DOCKER_BUILD_FLAGS)

DOCKER_NS ?= hyperledger
Expand Down

0 comments on commit ab6bef3

Please sign in to comment.