Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add arm support #142

Open
wants to merge 3 commits into
base: ecf
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
# Copy the controller-manager into a thin image
#FROM alpine:3.11
FROM gcr.io/distroless/static:latest
ARG ARCH
WORKDIR /
COPY bin/manager ./
COPY bin/${ARCH}/manager ./
USER nobody
ENTRYPOINT ["/manager"]
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PROD_REGISTRY := mocimages.azurecr.io
IMAGE_NAME ?= caphcontroller
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
TAG := $(MAJOR_VER).$(MINOR_VER).$(PATCH_VER)${TAGSUFFIX_APPEND}
ARCH := amd64
ARCH ?= amd64
ALL_ARCH = amd64 arm arm64 ppc64le s390x

# Local repository path for development
Expand Down Expand Up @@ -121,11 +121,11 @@ $(KUBECTL) $(KUBE_APISERVER) $(ETCD): ## install test asset kubectl, kube-apiser
## --------------------------------------

.PHONY: binaries
binaries: manager ## Builds and installs all binaries
binaries: manager ## Builds and installs all binaries
bfjelds marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: manager
manager: ## Build manager binary.
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o bin/manager cmd/manager/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags '-extldflags "-static"' -o bin/$(ARCH)/manager cmd/manager/main.go

## --------------------------------------
## Tooling Binaries
Expand Down Expand Up @@ -218,9 +218,9 @@ docker-login: ## Login docker to a private registry
docker login $(STAGING_REGISTRY) -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}

.PHONY: docker-build-img
docker-build-img: manager
docker-build-img: manager
bfjelds marked this conversation as resolved.
Show resolved Hide resolved
#docker build --pull --build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
docker build --pull --build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG):$(TAG)
docker build --pull --build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG):$(TAG)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove added space


.PHONY: docker-build
docker-build: docker-build-img ## Build the docker image for controller-manager
Expand Down