Skip to content

Commit

Permalink
Merge pull request #835 from nrb/fix-833
Browse files Browse the repository at this point in the history
Make fsfreeze image building consistent
  • Loading branch information
skriss authored Sep 12, 2018
2 parents 69e2f51 + e6b4453 commit 3eb1160
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif
# DOCKERFILE ?= Dockerfile.arm64 #aarch64/busybox
#endif

IMAGE := $(REGISTRY)/$(BIN)
IMAGE = $(REGISTRY)/$(BIN)

# If you want to build all binaries, see the 'all-build' rule.
# If you want to build all containers, see the 'all-container' rule.
Expand Down Expand Up @@ -129,17 +129,21 @@ shell: build-dirs build-image

DOTFILE_IMAGE = $(subst :,_,$(subst /,_,$(IMAGE))-$(VERSION))

# Use a slightly customized build/push targets since we don't have a Go binary to build for the fsfreeze image
build-fsfreeze: BIN = fsfreeze-pause
build-fsfreeze:
@docker build -t $(REGISTRY)/fsfreeze-pause:$(VERSION) -f Dockerfile-fsfreeze-pause.alpine _output
@docker images -q $(REGISTRY)/fsfreeze-pause:$(VERSION) > $@
@cp $(DOCKERFILE) _output/.dockerfile-$(BIN).alpine
@docker build -t $(IMAGE):$(VERSION) -f _output/.dockerfile-$(BIN).alpine _output
@docker images -q $(IMAGE):$(VERSION) > .container-$(DOTFILE_IMAGE)

push-fsfreeze: BIN = fsfreeze-pause
push-fsfreeze:
@docker push $(REGISTRY)/fsfreeze-pause:$(VERSION)
@docker push $(IMAGE):$(VERSION)
ifeq ($(TAG_LATEST), true)
docker tag $(REGISTRY)/fsfreeze-pause:$(VERSION) $(IMAGE):latest
docker push $(REGISTRY)/fsfreeze-pause:latest
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
docker push $(IMAGE):latest
endif
@docker images -q $(REGISTRY)/fsfreeze-pause:$(VERSION) > $@
@docker images -q $(REGISTRY)/fsfreeze-pause:$(VERSION) > .container-$(DOTFILE_IMAGE)

all-containers:
$(MAKE) container
Expand Down

0 comments on commit 3eb1160

Please sign in to comment.