Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright AppsCode Inc. and Contributors
#
# Licensed under the AppsCode Community License 1.0.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM {ARG_FROM}

LABEL org.opencontainers.image.source="https://github.com/kubeops/taskqueue" \
name="TaskQueue" \
maintainer=AppsCode \
vendor=AppsCode \
version={ARG_TAG} \
release={ARG_TAG} \
summary="TaskQueue is a Kubernetes controller that manages a queue of tasks" \
description="TaskQueue is a Kubernetes controller that manages a queue of tasks. It is designed to be used task processing system by mainting a queue with max concurrent task at a time."

RUN mkdir -p /licenses
COPY LICENSE.md /licenses/

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

USER 65534

ENTRYPOINT ["/{ARG_BIN}"]
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

BASEIMAGE_PROD ?= alpine
BASEIMAGE_DBG ?= debian:12
BASEIMAGE_UBI ?= registry.access.redhat.com/ubi10/ubi-minimal

IMAGE := $(if $(FQDN),$(FQDN)/,)$(REGISTRY)/$(BIN)
VERSION_PROD := $(VERSION)
VERSION_DBG := $(VERSION)-dbg
VERSION_UBI := $(VERSION)-ubi
TAG := $(VERSION)_$(OS)_$(ARCH)
TAG_PROD := $(TAG)
TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
TAG_UBI := $(VERSION)-ubi_$(OS)_$(ARCH)

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

DOCKERFILE_PROD = Dockerfile.in
DOCKERFILE_DBG = Dockerfile.dbg
DOCKERFILE_UBI = Dockerfile.ubi

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

Expand Down Expand Up @@ -223,15 +227,16 @@ endif
# Used to track state in hidden files.
DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(TAG)

container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG
container: bin/.container-$(DOTFILE_IMAGE)-PROD bin/.container-$(DOTFILE_IMAGE)-DBG bin/.container-$(DOTFILE_IMAGE)-UBI
ifeq (,$(SRC_REG))
bin/.container-$(DOTFILE_IMAGE)-%: bin/$(BIN)-$(OS)-$(ARCH) $(DOCKERFILE_%)
@echo "container: $(IMAGE):$(TAG_$*)"
@sed \
@sed \
-e 's|{ARG_BIN}|$(BIN)|g' \
-e 's|{ARG_ARCH}|$(ARCH)|g' \
-e 's|{ARG_OS}|$(OS)|g' \
-e 's|{ARG_FROM}|$(BASEIMAGE_$*)|g' \
-e 's|{ARG_TAG}|$(TAG)|g' \
$(DOCKERFILE_$*) > bin/.dockerfile-$*-$(OS)_$(ARCH)
@docker buildx build --platform $(OS)/$(ARCH) --load --pull -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
@docker images -q $(IMAGE):$(TAG_$*) > $@
Expand All @@ -243,17 +248,17 @@ bin/.container-$(DOTFILE_IMAGE)-%:
@echo
endif

push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG
push: bin/.push-$(DOTFILE_IMAGE)-PROD bin/.push-$(DOTFILE_IMAGE)-DBG bin/.push-$(DOTFILE_IMAGE)-UBI
bin/.push-$(DOTFILE_IMAGE)-%: bin/.container-$(DOTFILE_IMAGE)-%
@docker push $(IMAGE):$(TAG_$*)
@echo "pushed: $(IMAGE):$(TAG_$*)"
@echo

.PHONY: docker-manifest
docker-manifest: docker-manifest-PROD docker-manifest-DBG
docker-manifest: docker-manifest-PROD docker-manifest-DBG docker-manifest-UBI
docker-manifest-%:
docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
docker manifest push $(IMAGE):$(VERSION_$*)
@docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM)))
@docker manifest push $(IMAGE):$(VERSION_$*)

.PHONY: test
test: unit-tests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# taskqueue

KubeOps TaskQueue is a Kubernetes controller that manages a queue of tasks. It is designed to be used task processing system by mainting a queue with max concurrent task at a time.
TaskQueue is a Kubernetes controller that manages a queue of tasks. It is designed to be used task processing system by mainting a queue with max concurrent task at a time.

## Deploy into a Kubernetes Cluster

Expand Down
Loading