From 51b11d01196dbab98d6cdaa073c7688d098bbef0 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Wed, 9 Feb 2022 16:00:53 +0530 Subject: [PATCH] =?UTF-8?q?fix(makefile):=20=F0=9F=A9=B9=20buildx=20fix=20?= =?UTF-8?q?for=20pushing=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 21edec847d..b8528257ed 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ build-frontend-amd64: @echo "--> Building frontend docker image for amd64" @echo "------------------" @cd $(FRONTEND_DIRECTORY) && \ - docker build -f Dockerfile --no-cache -t $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) . --build-arg TARGETPLATFORM="linux/amd64" + docker build -f Dockerfile --no-cache -t $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) --build-arg TARGETPLATFORM="linux/amd64" . # Step to build and push docker image of frontend(used in push pipeline) build-push-frontend: @@ -50,9 +50,7 @@ ifndef DOCKER_SECOND_TAG docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/amd64 --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) . else @cd $(FRONTEND_DIRECTORY) && \ - docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/amd64 . \ - --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) \ - --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) + docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/amd64 --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_TAG) --tag $(REPONAME)/$(FRONTEND_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) . endif # Steps to build and push docker image of query service @@ -63,9 +61,7 @@ build-query-service-amd64: @echo "--> Building query-service docker image for amd64" @echo "------------------" @cd $(QUERY_SERVICE_DIRECTORY) && \ - docker build -f Dockerfile --no-cache -t $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) . \ - --build-arg TARGETPLATFORM="linux/amd64" \ - --build-arg LD_FLAGS=$(LD_FLAGS) + docker build -f Dockerfile --no-cache -t $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) . --build-arg TARGETPLATFORM="linux/amd64" --build-arg LD_FLAGS=$(LD_FLAGS) # Step to build and push docker image of query in amd64 and arm64 (used in push pipeline) build-push-query-service: @@ -74,17 +70,10 @@ build-push-query-service: @echo "------------------" ifndef DOCKER_SECOND_TAG @cd $(QUERY_SERVICE_DIRECTORY) && \ - docker buildx build --file Dockerfile --progress plane --no-cache --push \ - --platform linux/arm64,linux/amd64 . \ - --build-arg LD_FLAGS=$(LD_FLAGS) \ - --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) + docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --build-arg LD_FLAGS=$(LD_FLAGS) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) . else @cd $(QUERY_SERVICE_DIRECTORY) && \ - docker buildx build --file Dockerfile --progress plane --no-cache \ - --push --platform linux/arm64,linux/amd64 . \ - --build-arg LD_FLAGS=$(LD_FLAGS) \ - --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) \ - --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) + docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --build-arg LD_FLAGS=$(LD_FLAGS) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_TAG) --tag $(REPONAME)/$(QUERY_SERVICE_DOCKER_IMAGE):$(DOCKER_SECOND_TAG) . endif # Steps to build and push docker image of flattener