Skip to content

Commit

Permalink
one-more
Browse files Browse the repository at this point in the history
  • Loading branch information
sergicastro committed Aug 12, 2024
1 parent 264cfef commit 0591188
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
env:
IMG: tetrate/kubegres:${{ github.ref_name }}
PLATFORMS: linux/amd64
PLATFORMS: linux/amd64,linux/arm64
steps:
- uses: docker/setup-qemu-action@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ FROM gcr.io/distroless/static:nonroot

ARG TARGETPLATFORM

USER 65532:65532
COPY build/bin/${TARGETPLATFORM}/manager /

WORKDIR /
COPY build/bin/${TARGETPLATFORM}/manager /manager

ENTRYPOINT ["/manager"]
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ build/%: PLATFORM=$(*)
build/%: GOARCH=$(notdir $(PLATFORM))
build/%: GOOS=$(subst /,,$(dir $(PLATFORM)))
build/%: ## Build manager binary for a specific platform.
GOOS=${GOOS} GOARCH=${GOARCH} go build -o build/bin/$(PLATFORM)/manager main.go
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o build/bin/$(PLATFORM)/manager main.go

.PHONY: run
run: install ## Run a controller from your host.
Expand All @@ -98,7 +98,7 @@ DOCKER_BUILDER_NAME?=kubegres
docker-buildx:
docker buildx inspect $(DOCKER_BUILDER_NAME) || \
docker buildx create --name $(DOCKER_BUILDER_NAME) --driver docker-container --driver-opt network=host \
--buildkitd-flags '--allow-insecure-entitlement network.host' --platform linux/amd64,linux/arm64
--buildkitd-flags '--allow-insecure-entitlement network.host' --platform ${PLATFORMS}

#docker-build: test ## Build docker image with the manager.
.PHONY: docker-build-push
Expand All @@ -114,9 +114,7 @@ docker-build/%: PLATFORM=$(*)
docker-build/%: DOCKER_OS=$(subst /,,$(dir $(PLATFORM)))
docker-build/%: DOCKER_ARCH=$(notdir $(PLATFORM))
docker-build/%: docker-buildx ## Build docker image with ARCH as image tag suffix.
docker buildx build --builder $(DOCKER_BUILDER_NAME) --platform ${PLATFORM} \
--build-arg TARGETOS=$(DOCKER_OS) --build-arg TARGETARCH=$(DOCKER_ARCH) \
-t ${IMG}-${DOCKER_ARCH} --load .
docker buildx build --builder $(DOCKER_BUILDER_NAME) --platform ${PLATFORM} -t ${IMG}-${DOCKER_ARCH} --load .

.PHONY: scan-local
scan-local: IMG=local/kubegres:scan-${LOCAL_ARCH}
Expand Down

0 comments on commit 0591188

Please sign in to comment.