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

Commit 9a31d03

Browse files
authored
Merge pull request #17 from 3scale-ops/feat/update-container-base-image
feat: Update container base image
2 parents 8ef0319 + 97c39c2 commit 9a31d03

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ BUILD_NAME ?= aws-nlb-helper-operator
44
BUILD_PATH ?= build/_output/bin
55
DEPLOY_PATH ?= deploy/iam-env-credentials
66
GO_COVERAGE ?= ./coverage.txt
7-
DOCKER_IMAGE ?= quay.io/3scale/aws-nlb-helper-operator
7+
CONTAINER_IMAGE ?= quay.io/3scale/aws-nlb-helper-operator
88
KUBECTL ?= kubectl
99
NAMESPACE ?= aws-nlb-helper
1010

11+
CONTAINER_ENGINE ?= $(which docker)
12+
1113
.PHONY: build
1214

1315
UNAME_S := $(shell uname -s)
@@ -30,10 +32,10 @@ test: ## Run tests
3032
go test ./... -race -coverprofile=$(GO_COVERAGE) -covermode=atomic
3133

3234
operator-image-build: build ## Build operator Docker image
33-
docker build . -f build/Dockerfile -t $(DOCKER_IMAGE):$(RELEASE)
35+
${CONTAINER_ENGINE} build . -f build/Dockerfile -t $(CONTAINER_IMAGE):$(RELEASE)
3436

3537
operator-image-push: ## Push operator Docker image to remote registry
36-
docker push $(DOCKER_IMAGE):$(RELEASE)
38+
${CONTAINER_ENGINE} push $(CONTAINER_IMAGE):$(RELEASE)
3739

3840
operator-image-update: operator-image-build operator-image-push ## Build and Push Operator Docker image to remote registry
3941

@@ -43,9 +45,9 @@ operator-deploy: ## Create/Update Operator objects
4345
$(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/service_account.yaml
4446
$(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/role.yaml
4547
$(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/role_binding.yaml
46-
$(INPLACE_SED) 's@REPLACE_IMAGE@$(DOCKER_IMAGE):$(RELEASE)@g' $(DEPLOY_PATH)/operator.yaml
48+
$(INPLACE_SED) 's@REPLACE_IMAGE@$(CONTAINER_IMAGE):$(RELEASE)@g' $(DEPLOY_PATH)/operator.yaml
4749
$(KUBECTL) apply -n $(NAMESPACE) -f $(DEPLOY_PATH)/operator.yaml
48-
$(INPLACE_SED) 's@$(DOCKER_IMAGE):$(RELEASE)@REPLACE_IMAGE@g' $(DEPLOY_PATH)/operator.yaml
50+
$(INPLACE_SED) 's@$(CONTAINER_IMAGE):$(RELEASE)@REPLACE_IMAGE@g' $(DEPLOY_PATH)/operator.yaml
4951

5052
operator-delete: ## Delete Operator objects
5153
$(KUBECTL) delete -n $(NAMESPACE) -f $(DEPLOY_PATH)/operator.yaml || true

OWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
approvers:
2+
- raelga
3+
- roivaz
4+
- slopezz
5+
reviewers:
6+
- raelga
7+
- roivaz
8+
- slopezz

build/Dockerfile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
1+
FROM gcr.io/distroless/static:nonroot
22

3-
ENV OPERATOR=/usr/local/bin/aws-nlb-helper-operator \
4-
USER_UID=1001 \
5-
USER_NAME=aws-nlb-helper-operator
3+
COPY build/_output/bin/aws-nlb-helper-operator \
4+
/usr/local/bin/aws-nlb-helper-operator
65

7-
# install operator binary
8-
COPY build/_output/bin/aws-nlb-helper-operator ${OPERATOR}
9-
10-
COPY build/bin /usr/local/bin
11-
RUN /usr/local/bin/user_setup
12-
13-
ENTRYPOINT ["/usr/local/bin/entrypoint"]
14-
15-
USER ${USER_UID}
6+
ENTRYPOINT ["/usr/local/bin/aws-nlb-helper-operator"]

0 commit comments

Comments
 (0)