Skip to content

Commit a8b27ac

Browse files
committed
FIXUP: allow Docker
1 parent 39e9287 commit a8b27ac

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
IMAGE ?= localhost/postgres-operator:latest
23
PGMONITOR_DIR ?= hack/tools/pgmonitor
34
PGMONITOR_VERSION ?= v5.2.1
45
QUERIES_CONFIG_DIR ?= hack/tools/queries
@@ -44,7 +45,7 @@ notes: ## List known issues and future considerations
4445
.PHONY: clean
4546
clean: ## Clean resources
4647
clean: clean-deprecated
47-
rm -f bin/postgres-operator
48+
rm -f bin/postgres-operator image.tar
4849
rm -rf licenses/*/
4950
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
5051
[ ! -d hack/tools/envtest ] || { chmod -R u+w hack/tools/envtest && rm -r hack/tools/envtest; }
@@ -133,7 +134,7 @@ deploy-dev: createnamespaces
133134

134135
.PHONY: build
135136
build: ## Build a postgres-operator image
136-
$(BUILDAH) build --tag localhost/postgres-operator \
137+
$(BUILDAH) build --tag '$(IMAGE)' \
137138
--label org.opencontainers.image.authors='Crunchy Data' \
138139
--label org.opencontainers.image.description='Crunchy PostgreSQL Operator' \
139140
--label org.opencontainers.image.revision='$(shell git rev-parse HEAD)' \
@@ -146,7 +147,11 @@ build-kind: image.tar ; $(or $(KIND),kind) load image-archive $<
146147
build-minikube: image.tar ; $(or $(MINIKUBE),minikube) image load $<
147148

148149
image.tar: build
149-
$(BUILDAH) push localhost/postgres-operator oci-archive:$@:localhost/postgres-operator:latest
150+
set -x && \
151+
case '$(BUILDAH)' in \
152+
'docker') docker image save '--output=$@' '$(IMAGE)' ;; \
153+
*) $(BUILDAH) push '$(IMAGE)' 'oci-archive:$@:$(IMAGE)' ;; \
154+
esac
150155

151156
##@ Test
152157

0 commit comments

Comments
 (0)