Skip to content

Commit 3263311

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

File tree

4 files changed

+46
-9
lines changed

4 files changed

+46
-9
lines changed

Dockerfile.dbg

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

1717
FROM {ARG_FROM}
1818

19-
LABEL org.opencontainers.image.source https://github.com/bytebuilders/cloudflare-dns-proxy
19+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/cloudflare-dns-proxy
2020

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

Dockerfile.in

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

1515
FROM {ARG_FROM}
1616

17-
LABEL org.opencontainers.image.source https://github.com/bytebuilders/cloudflare-dns-proxy
17+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/cloudflare-dns-proxy
1818

1919
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
2020

Dockerfile.ubi

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright AppsCode Inc. and Contributors.
2+
#
3+
# Licensed under the Apache License, Version 2.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+
# http://www.apache.org/licenses/LICENSE-2.0
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+
FROM {ARG_FROM}
16+
17+
LABEL org.opencontainers.image.source="https://github.com/appscode-cloud/cloudflare-dns-proxy" \
18+
name="ACE DNS Proxy for Cloudflare" \
19+
maintainer=AppsCode \
20+
vendor=AppsCode \
21+
version={ARG_TAG} \
22+
release={ARG_TAG} \
23+
summary="ACE DNS Proxy for Cloudflare" \
24+
description="FACE DNS Proxy for Cloudflare"
25+
26+
RUN mkdir -p /licenses
27+
COPY LICENSE /licenses/
28+
29+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
30+
31+
USER 65534
32+
33+
ENTRYPOINT ["/{ARG_BIN}"]

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,17 @@ OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
6262
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
6363

6464
BASEIMAGE_PROD ?= gcr.io/distroless/static-debian12
65-
# BASEIMAGE_PROD ?= alpine
6665
BASEIMAGE_DBG ?= debian:12
66+
BASEIMAGE_UBI ?= registry.access.redhat.com/ubi10/ubi-minimal
6767

6868
IMAGE := $(REGISTRY)/$(BIN)
6969
VERSION_PROD := $(VERSION)
7070
VERSION_DBG := $(VERSION)-dbg
71+
VERSION_UBI := $(VERSION)-ubi
7172
TAG := $(VERSION)_$(OS)_$(ARCH)
7273
TAG_PROD := $(TAG)
7374
TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
75+
TAG_UBI := $(VERSION)-ubi_$(OS)_$(ARCH)
7476

7577
GO_VERSION ?= 1.25
7678
BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION)
@@ -93,6 +95,7 @@ BUILD_DIRS := bin/$(OS)_$(ARCH) \
9395

9496
DOCKERFILE_PROD = Dockerfile.in
9597
DOCKERFILE_DBG = Dockerfile.dbg
98+
DOCKERFILE_UBI = Dockerfile.ubi
9699

97100
DOCKER_REPO_ROOT := /go/src/$(GO_PKG)/$(REPO)
98101

@@ -221,15 +224,16 @@ endif
221224
# Used to track state in hidden files.
222225
DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(TAG)
223226

224-
container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG
227+
container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG bin/.container-$(DOTFILE_IMAGE)-UBI
225228
ifeq (,$(SRC_REG))
226229
bin/.container-$(DOTFILE_IMAGE)-%: bin/$(BIN)-$(OS)-$(ARCH) $(DOCKERFILE_%)
227230
@echo "container: $(IMAGE):$(TAG_$*)"
228-
@sed \
231+
@sed \
229232
-e 's|{ARG_BIN}|$(BIN)|g' \
230233
-e 's|{ARG_ARCH}|$(ARCH)|g' \
231234
-e 's|{ARG_OS}|$(OS)|g' \
232235
-e 's|{ARG_FROM}|$(BASEIMAGE_$*)|g' \
236+
-e 's|{ARG_TAG}|$(TAG)|g' \
233237
$(DOCKERFILE_$*) > bin/.dockerfile-$*-$(OS)_$(ARCH)
234238
@docker buildx build --platform $(OS)/$(ARCH) --load --pull -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
235239
@docker images -q $(IMAGE):$(TAG_$*) > $@
@@ -241,17 +245,17 @@ bin/.container-$(DOTFILE_IMAGE)-%:
241245
@echo
242246
endif
243247

244-
push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG
248+
push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG bin/.push-$(DOTFILE_IMAGE)-UBI
245249
bin/.push-$(DOTFILE_IMAGE)-%: bin/.container-$(DOTFILE_IMAGE)-%
246250
@docker push $(IMAGE):$(TAG_$*)
247251
@echo "pushed: $(IMAGE):$(TAG_$*)"
248252
@echo
249253

250254
.PHONY: docker-manifest
251-
docker-manifest: docker-manifest-PROD docker-manifest-DBG
255+
docker-manifest: docker-manifest-PROD docker-manifest-DBG docker-manifest-UBI
252256
docker-manifest-%:
253-
docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
254-
docker manifest push $(IMAGE):$(VERSION_$*)
257+
@docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
258+
@docker manifest push $(IMAGE):$(VERSION_$*)
255259

256260
.PHONY: test
257261
test: unit-tests e2e-tests

0 commit comments

Comments
 (0)