Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from 3scale-ops/feat/update-container-base-image
Browse files Browse the repository at this point in the history
feat: Update container base image
  • Loading branch information
raelga authored Sep 17, 2021
2 parents 8ef0319 + 97c39c2 commit 9a31d03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- raelga
- roivaz
- slopezz
reviewers:
- raelga
- roivaz
- slopezz
17 changes: 4 additions & 13 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 9a31d03

Please sign in to comment.