From 5a49e4ee62bc962fd4859153010496d65a51070c Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 11:03:52 -0400 Subject: [PATCH 01/11] added .github/build-push-images.yml for workflow --- .github/build-push-images.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/build-push-images.yml diff --git a/.github/build-push-images.yml b/.github/build-push-images.yml new file mode 100644 index 0000000..353b8cc --- /dev/null +++ b/.github/build-push-images.yml @@ -0,0 +1,43 @@ +name: Docker Image CI + +on: + push: + pull_request: + +env: + REGISTRY: ghcr.io + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v4 + + - name: Login to the Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract Metadata (tags and labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ github.repository }} + + - name: Build & Push Docker Image(s) + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64 + tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/${{ github.repository }}:latest + labels: ${{ steps.meta.outputs.labels }} From eef10fa6b2d53b35b8a191dace0d8838e04b5b60 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 11:18:54 -0400 Subject: [PATCH 02/11] added branch and pr push logic for actions --- .github/build-push-images.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/build-push-images.yml b/.github/build-push-images.yml index 353b8cc..d7ef4ec 100644 --- a/.github/build-push-images.yml +++ b/.github/build-push-images.yml @@ -2,8 +2,10 @@ name: Docker Image CI on: push: + branches: [ "main", "dev", 'releases/**', 'issue_**' ] pull_request: - + branches: [ "main", "dev" ] + env: REGISTRY: ghcr.io From b360971a55fa5838865fd73bb0d29b8e85b1b878 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 11:41:46 -0400 Subject: [PATCH 03/11] moved yaml into workflows/*.yaml --- .github/{ => workflows}/build-push-images.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/build-push-images.yml (100%) diff --git a/.github/build-push-images.yml b/.github/workflows/build-push-images.yml similarity index 100% rename from .github/build-push-images.yml rename to .github/workflows/build-push-images.yml From 72440045cb640f5951351ad65e12349ef8db13b7 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 12:39:25 -0400 Subject: [PATCH 04/11] Update build-push-images.yml --- .github/workflows/build-push-images.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index d7ef4ec..3ec8eb1 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -41,5 +41,6 @@ jobs: context: . push: true platforms: linux/amd64 - tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/${{ github.repository }}:latest +# tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/${{ github.repository }}:latest + tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/nos3-64:dev labels: ${{ steps.meta.outputs.labels }} From 640356c20d65ffe99289eb2a9189252a17f0373b Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 12:53:11 -0400 Subject: [PATCH 05/11] changed repos name to match the desired image name --- .github/workflows/build-push-images.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index 3ec8eb1..fe45bff 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -8,7 +8,6 @@ on: env: REGISTRY: ghcr.io - jobs: build: @@ -41,6 +40,5 @@ jobs: context: . push: true platforms: linux/amd64 -# tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/${{ github.repository }}:latest - tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}, ${{ env.REGISTRY }}/nos3-64:dev + tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} labels: ${{ steps.meta.outputs.labels }} From 3fc239af636f9fb4b292fb0645c3c1e189700541 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 15:17:20 -0400 Subject: [PATCH 06/11] added linux/arm64 platform for building --- .github/workflows/build-push-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index fe45bff..0d5b9f9 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -39,6 +39,6 @@ jobs: with: context: . push: true - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} labels: ${{ steps.meta.outputs.labels }} From 40eccf16afeeea3d46a8c10c8c66337fc584079a Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 15:44:40 -0400 Subject: [PATCH 07/11] removed linux/arm64 due to error ERROR: https://github.com/haisamido/nos3-64/actions/runs/15981698304/job/45077321714#step:6:9123 --- .github/workflows/build-push-images.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index 0d5b9f9..76c552e 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -39,6 +39,7 @@ jobs: with: context: . push: true - platforms: linux/amd64,linux/arm64 + # removing linux/arm64 due to https://github.com/haisamido/nos3-64/actions/runs/15981698304/job/45077321714#step:6:9123 TBD + platforms: linux/amd64 tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} labels: ${{ steps.meta.outputs.labels }} From 268911cc7b5840063b199c0e34a8520c88863840 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Mon, 30 Jun 2025 16:13:19 -0400 Subject: [PATCH 08/11] enhancement of targets --- Makefile | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1249cd8 --- /dev/null +++ b/Makefile @@ -0,0 +1,63 @@ +SHELL := /bin/bash +.ONESHELL: +.DEFAULT_GOAL := help +.PHONY: all help + +# Executable definitions docker|podman etc. +CONTAINER_BIN =docker + +# Target tags for pushing to +REGISTRY_HOST=ghcr.io +IMAGE_USERNAME=haisamido +IMAGE_NAME=nos3-64 +IMAGE_TAG=dev + +IMAGE_URI=${REGISTRY_HOST}/${IMAGE_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG} + +# +DOCKERFILE=Dockerfile + +GIT_TOKEN=${HOME}/.github.com/access_token + +nos3-64-build: ## build nos3-base from nos3-64 (Look at Dockerfile) + @$(call print_message,33,Building ${IMAGE_URI} ...) + ${CONTAINER_BIN} build --file ${DOCKERFILE} -t ${IMAGE_URI} . + +nos3-64-push: | registry-login nos3-64-build ## push nos3-base (build runs first) + @$(call print_message,33,Pushing ${IMAGE_URI} ...) + ${CONTAINER_BIN} push ${IMAGE_URI} + +registry-login: ## image registry-login + @$(call print_message,33,Logging into ${REGISTRY_HOST} via ${CONTAINER_BIN} login ...) + @cat ${GIT_TOKEN} | \ + ${CONTAINER_BIN} login ${REGISTRY_HOST} -u ${IMAGE_USERNAME} --password-stdin + +#------------------------------------------------------------------------------ +define print_header + @printf '%*s\n' "$(TERM_WIDTH)" '' | tr ' ' '-' + @printf '%-*s\n' "$(TERM_WIDTH)" "$(1)" + @printf '%*s\n' "$(TERM_WIDTH)" '' | tr ' ' '-' +endef + +define print_message + @printf "\033[$(1)m$(2)\033[0m\n" +endef +#------------------------------------------------------------------------------ + +#--- +RESET = \033[0m +PURPLE = \033[0;35m +GREEN = \033[0;32m +LINE = $(PURPLE)----------------------------------------------------------------------------------------$(RESET) + +help: ## this help target + @echo + @printf "\033[37m%-30s\033[0m %s\n" "#----------------------------------------------------------------------------------------" + @printf "\033[37m%-30s\033[0m %s\n" "# Makefile targets: make , e.g. make registry-login " + @printf "\033[37m%-30s\033[0m %s\n" "#----------------------------------------------------------------------------------------" + @echo + @printf "\033[37m%-30s\033[0m %s\n" "#-target-----------------------description-----------------------------------------------" + @grep -E '^[a-zA-Z_-].+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + @echo + +print-% : ; @echo $* = $($*) From d5e2bf0acc411363f9172c5e9d837bc7f91c8acc Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Tue, 1 Jul 2025 12:07:28 -0400 Subject: [PATCH 09/11] added nos3-64-pull-prebuilt --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1249cd8..fec4670 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,13 @@ SHELL := /bin/bash # Executable definitions docker|podman etc. CONTAINER_BIN =docker +GIT_BRANCH=$(shell git branch --show-current) + # Target tags for pushing to REGISTRY_HOST=ghcr.io IMAGE_USERNAME=haisamido IMAGE_NAME=nos3-64 -IMAGE_TAG=dev +IMAGE_TAG=${GIT_BRANCH} IMAGE_URI=${REGISTRY_HOST}/${IMAGE_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG} @@ -19,11 +21,14 @@ DOCKERFILE=Dockerfile GIT_TOKEN=${HOME}/.github.com/access_token +nos3-64-pull-prebuilt: ## pull pre-built nos3-64 from remote + ${CONTAINER_BIN} pull ${IMAGE_URI} + nos3-64-build: ## build nos3-base from nos3-64 (Look at Dockerfile) @$(call print_message,33,Building ${IMAGE_URI} ...) ${CONTAINER_BIN} build --file ${DOCKERFILE} -t ${IMAGE_URI} . -nos3-64-push: | registry-login nos3-64-build ## push nos3-base (build runs first) +nos3-64-push: | registry-login nos3-64-build ## push nos3-64 to remote (build runs first) @$(call print_message,33,Pushing ${IMAGE_URI} ...) ${CONTAINER_BIN} push ${IMAGE_URI} From 8d8f4b9dc9d560ec6a4741971c5fef4f6dbb2755 Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Fri, 11 Jul 2025 09:55:40 -0400 Subject: [PATCH 10/11] trying linux/arm64 --- .github/workflows/build-push-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index 76c552e..6b4f053 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -40,6 +40,6 @@ jobs: context: . push: true # removing linux/arm64 due to https://github.com/haisamido/nos3-64/actions/runs/15981698304/job/45077321714#step:6:9123 TBD - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} labels: ${{ steps.meta.outputs.labels }} From 585bb3a07d9ac7aa05f7706ad985eac3604c741c Mon Sep 17 00:00:00 2001 From: Haisam Ido Date: Fri, 7 Nov 2025 10:36:29 -0500 Subject: [PATCH 11/11] Update GitHub Actions workflow with addition of workflow_dispatch: Added workflow_dispatch trigger for manual execution. --- .github/workflows/build-push-images.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index 6b4f053..3356eb4 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -1,13 +1,15 @@ name: Docker Image CI on: + workflow_dispatch: push: branches: [ "main", "dev", 'releases/**', 'issue_**' ] pull_request: branches: [ "main", "dev" ] - + env: REGISTRY: ghcr.io + jobs: build: @@ -39,7 +41,6 @@ jobs: with: context: . push: true - # removing linux/arm64 due to https://github.com/haisamido/nos3-64/actions/runs/15981698304/job/45077321714#step:6:9123 TBD platforms: linux/amd64,linux/arm64 tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} labels: ${{ steps.meta.outputs.labels }}