Skip to content
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

.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
#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