Skip to content

Commit f61320b

Browse files
authored
Add new target for building docker images with no tests (#415)
1 parent 7acb50c commit f61320b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.9
1+
1.21

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ VERSION ?= $(GIT_VERSION)
1313
IMAGE ?= $(REPO):$(VERSION)
1414
BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:latest.2
1515
GOLANG_VERSION ?= $(shell cat .go-version)
16-
BUILD_IMAGE ?= public.ecr.aws/bitnami/golang:$(GOLANG_VERSION)
16+
BUILD_IMAGE ?= public.ecr.aws/docker/library/golang:$(GOLANG_VERSION)
1717
GOARCH ?= amd64
1818
PLATFORM ?= linux/amd64
1919

20-
export GOSUMDB = sum.golang.org
21-
export GOTOOLCHAIN = go$(GOLANG_VERSION)
22-
2320
help: ## Display help
2421
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
2522

@@ -79,6 +76,11 @@ docker-buildx: check-env test
7976
docker-build: check-env test
8077
docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg ARCH=$(GOARCH) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) . -t ${IMAGE}
8178

79+
80+
# Build the docker image with buildx and no tests
81+
docker-buildx-no-test:
82+
docker buildx build --platform=$(PLATFORM) -t $(IMAGE)_$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg $(GOARCH) --load .
83+
8284
# Push the docker image
8385
docker-push: check-env
8486
docker push ${IMAGE}

0 commit comments

Comments
 (0)