Skip to content

Commit 7f0e236

Browse files
committed
Build ubi image
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 6709998 commit 7f0e236

File tree

4 files changed

+55
-7
lines changed

4 files changed

+55
-7
lines changed

Dockerfile.dbg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FROM ghcr.io/appscode/dlv:1.25
1717

1818
FROM {ARG_FROM}
1919

20-
LABEL org.opencontainers.image.source https://github.com/bytebuilders/kube-bind
20+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/kube-bind
2121

2222
RUN set -x \
2323
&& apt-get update \

Dockerfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
FROM {ARG_FROM}
1717

18-
LABEL org.opencontainers.image.source https://github.com/bytebuilders/kube-bind
18+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/kube-bind
1919

2020
RUN set -x \
2121
&& apk add --update --upgrade --no-cache pcre2 ca-certificates tzdata \

Dockerfile.ubi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright AppsCode Inc. and Contributors
2+
#
3+
# Licensed under the AppsCode Community License 1.0.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
FROM {ARG_FROM}
17+
18+
LABEL org.opencontainers.image.source="https://github.com/appscode-cloud/kube-bind" \
19+
name="ACE kube-bind operator" \
20+
maintainer=AppsCode \
21+
vendor=AppsCode \
22+
version={ARG_TAG} \
23+
release={ARG_TAG} \
24+
summary="ACE kube-bind operator" \
25+
description="ACE kube-bind operator"
26+
27+
RUN mkdir -p /licenses
28+
COPY LICENSE.md /licenses/
29+
30+
RUN set -x \
31+
&& microdnf update -y \
32+
&& microdnf install -y ca-certificates tzdata \
33+
&& microdnf clean all
34+
35+
ENV TZ=Etc/UTC
36+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
37+
38+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
39+
40+
USER 65534
41+
42+
ENTRYPOINT ["/{ARG_BIN}"]

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,18 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) linux/arm windows/amd64 darwin/amd64 dar
6565
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
6666
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
6767

68-
# BASEIMAGE_PROD ?= gcr.io/distroless/static-debian12
6968
BASEIMAGE_PROD ?= alpine
7069
BASEIMAGE_DBG ?= debian:12
70+
BASEIMAGE_UBI ?= registry.access.redhat.com/ubi10/ubi-minimal
7171

7272
IMAGE := $(REGISTRY)/$(BIN)
7373
VERSION_PROD := $(VERSION)
7474
VERSION_DBG := $(VERSION)-dbg
75+
VERSION_UBI := $(VERSION)-ubi
7576
TAG := $(VERSION)_$(OS)_$(ARCH)
7677
TAG_PROD := $(TAG)
7778
TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
79+
TAG_UBI := $(VERSION)-ubi_$(OS)_$(ARCH)
7880

7981
GO_VERSION ?= 1.25
8082
BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION)
@@ -96,6 +98,7 @@ BUILD_DIRS := bin/$(OS)_$(ARCH) \
9698

9799
DOCKERFILE_PROD = Dockerfile.in
98100
DOCKERFILE_DBG = Dockerfile.dbg
101+
DOCKERFILE_UBI = Dockerfile.ubi
99102

100103
DOCKER_REPO_ROOT := /go/src/$(GO_PKG)/$(REPO)
101104

@@ -290,7 +293,7 @@ endif
290293
# Used to track state in hidden files.
291294
DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(TAG)
292295

293-
container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG
296+
container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG bin/.container-$(DOTFILE_IMAGE)-UBI
294297
ifeq (,$(SRC_REG))
295298
bin/.container-$(DOTFILE_IMAGE)-%: bin/$(BIN)-$(OS)-$(ARCH) $(DOCKERFILE_%)
296299
@echo "container: $(IMAGE):$(TAG_$*)"
@@ -310,7 +313,7 @@ bin/.container-$(DOTFILE_IMAGE)-%:
310313
@echo
311314
endif
312315

313-
push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG
316+
push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG bin/.push-$(DOTFILE_IMAGE)-UBI
314317
bin/.push-$(DOTFILE_IMAGE)-%: bin/.container-$(DOTFILE_IMAGE)-%
315318
@docker push $(IMAGE):$(TAG_$*)
316319
@echo "pushed: $(IMAGE):$(TAG_$*)"
@@ -324,10 +327,13 @@ docker-manifest:
324327
@$(MAKE) docker-manifest-DBG \
325328
--no-print-directory \
326329
BIN=konnector
330+
@$(MAKE) docker-manifest-UBI \
331+
--no-print-directory \
332+
BIN=konnector
327333

328334
docker-manifest-%:
329-
docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
330-
docker manifest push $(IMAGE):$(VERSION_$*)
335+
@docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
336+
@docker manifest push $(IMAGE):$(VERSION_$*)
331337

332338
.PHONY: test
333339
test: unit-tests e2e-tests

0 commit comments

Comments
 (0)