diff --git a/Makefile b/Makefile index ffbb8fc..6e85631 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,12 @@ BUILD_NAME ?= aws-nlb-helper-operator BUILD_PATH ?= build/_output/bin DEPLOY_PATH ?= deploy/iam-env-credentials GO_COVERAGE ?= ./coverage.txt -DOCKER_IMAGE ?= quay.io/3scale/aws-nlb-helper-operator +CONTAINER_IMAGE ?= quay.io/3scale/aws-nlb-helper-operator KUBECTL ?= kubectl NAMESPACE ?= aws-nlb-helper +CONTAINER_ENGINE ?= $(which docker) + .PHONY: build UNAME_S := $(shell uname -s) @@ -30,10 +32,10 @@ test: ## Run tests go test ./... -race -coverprofile=$(GO_COVERAGE) -covermode=atomic operator-image-build: build ## Build operator Docker image - docker build . -f build/Dockerfile -t $(DOCKER_IMAGE):$(RELEASE) + ${CONTAINER_ENGINE} build . -f build/Dockerfile -t $(CONTAINER_IMAGE):$(RELEASE) operator-image-push: ## Push operator Docker image to remote registry - docker push $(DOCKER_IMAGE):$(RELEASE) + ${CONTAINER_ENGINE} push $(CONTAINER_IMAGE):$(RELEASE) operator-image-update: operator-image-build operator-image-push ## Build and Push Operator Docker image to remote registry @@ -43,9 +45,9 @@ operator-deploy: ## Create/Update Operator objects $(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/service_account.yaml $(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/role.yaml $(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/role_binding.yaml - $(INPLACE_SED) 's@REPLACE_IMAGE@$(DOCKER_IMAGE):$(RELEASE)@g' $(DEPLOY_PATH)/operator.yaml + $(INPLACE_SED) 's@REPLACE_IMAGE@$(CONTAINER_IMAGE):$(RELEASE)@g' $(DEPLOY_PATH)/operator.yaml $(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/operator.yaml - $(INPLACE_SED) 's@$(DOCKER_IMAGE):$(RELEASE)@REPLACE_IMAGE@g' $(DEPLOY_PATH)/operator.yaml + $(INPLACE_SED) 's@$(CONTAINER_IMAGE):$(RELEASE)@REPLACE_IMAGE@g' $(DEPLOY_PATH)/operator.yaml operator-delete: ## Delete Operator objects $(KUBECTL) delete -n $(NAMESPACE) -f $(DEPLOY_PATH)/operator.yaml || true diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..5f67bef --- /dev/null +++ b/OWNERS @@ -0,0 +1,8 @@ +approvers: + - raelga + - roivaz + - slopezz +reviewers: + - raelga + - roivaz + - slopezz diff --git a/build/Dockerfile b/build/Dockerfile index 1566b77..0aeaf57 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,15 +1,6 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +FROM gcr.io/distroless/static:nonroot -ENV OPERATOR=/usr/local/bin/aws-nlb-helper-operator \ - USER_UID=1001 \ - USER_NAME=aws-nlb-helper-operator +COPY build/_output/bin/aws-nlb-helper-operator \ + /usr/local/bin/aws-nlb-helper-operator -# install operator binary -COPY build/_output/bin/aws-nlb-helper-operator ${OPERATOR} - -COPY build/bin /usr/local/bin -RUN /usr/local/bin/user_setup - -ENTRYPOINT ["/usr/local/bin/entrypoint"] - -USER ${USER_UID} +ENTRYPOINT ["/usr/local/bin/aws-nlb-helper-operator"] \ No newline at end of file