Skip to content

Commit

Permalink
Update build image targetC
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedwaleedmalik committed Jul 29, 2021
1 parent 6397a35 commit cafbcbd
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions Makefile
@@ -1,6 +1,6 @@
# note: call scripts from /scripts

.PHONY: default build builder-image binary-image test stop clean-images clean push apply deploy release release-all manifest push clean-image
.PHONY: default build build-image test stop push apply deploy release release-all manifest push

OS ?= linux
ARCH ?= ???
Expand Down Expand Up @@ -29,20 +29,13 @@ install:
build:
"$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}"

builder-image:
docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${BUILDER}" --load -f build/package/Dockerfile.build .

reloader-${ARCH}.tar:
docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${BUILDER}" --load -f build/package/Dockerfile.build .
docker run --platform ${OS}/${ARCH} --rm "${BUILDER}" > reloader-${ARCH}.tar

binary-image: builder-image
cat reloader-${ARCH}.tar | docker buildx build --platform ${OS}/${ARCH} -t "${REPOSITORY_ARCH}" --load -f Dockerfile.run -
build-image:
docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${REPOSITORY_ARCH}" --load -f Dockerfile .

push:
docker push ${REPOSITORY_ARCH}

release: binary-image push manifest
release: build-image push manifest

release-all:
-rm -rf ~/.docker/manifests/*
Expand All @@ -66,23 +59,6 @@ test:
stop:
@docker stop "${BINARY}"

clean-images: stop
-docker rmi "${BINARY}"
@for arch in $(ALL_ARCH) ; do \
echo Clean image: $$arch ; \
make clean-image ARCH=$$arch ; \
done
-docker rmi "${REPOSITORY_GENERIC}"

clean-image:
-docker rmi "${BUILDER}"
-docker rmi "${REPOSITORY_ARCH}"
-rm -rf ~/.docker/manifests/*

clean:
"$(GOCMD)" clean -i
-rm -rf reloader-*.tar

apply:
kubectl apply -f deployments/manifests/ -n temp-reloader

Expand Down

0 comments on commit cafbcbd

Please sign in to comment.