From fc679e9982366a2abf8b03587d15aa746f15f160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Borov=C4=8Danin?= Date: Mon, 6 Apr 2026 10:19:30 +0200 Subject: [PATCH] NOISSUE - Use Github for Docker images (#3419) Signed-off-by: dusan --- Makefile | 8 ++--- docker/README.md | 3 +- docker/addons/bootstrap/docker-compose.yaml | 2 +- .../postgres-reader/docker-compose.yaml | 2 +- .../postgres-writer/docker-compose.yaml | 2 +- docker/addons/provision/docker-compose.yaml | 2 +- docker/docker-compose.yaml | 30 +++++++++---------- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 9aa6f3e13..114cb2a2b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ # Copyright (c) Abstract Machines # SPDX-License-Identifier: Apache-2.0 -MG_DOCKER_IMAGE_NAME_PREFIX ?= magistrala +override MG_DOCKER_IMAGE_NAME_PREFIX := ghcr.io/absmach/magistrala +MG_DOCKER_VOLUME_NAME_PREFIX ?= magistrala BUILD_DIR ?= build SERVICES = auth users clients groups channels domains notifications certs re postgres-writer postgres-reader timescale-writer timescale-reader cli alarms reports bootstrap journal fluxmq TEST_API_SERVICES = journal auth certs clients users channels groups domains @@ -84,8 +85,7 @@ define run_with_arch_detection git checkout $(1); \ GOARCH=arm64 $(MAKE) dockers; \ for svc in $(SERVICES); do \ - docker tag magistrala/$$svc magistrala/$$svc:latest; \ - docker tag magistrala/$$svc docker.io/magistrala/$$svc:latest; \ + docker tag $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest; \ done; \ sed -i.bak 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=latest/' docker/.env && rm -f docker/.env.bak; \ docker compose -f docker/docker-compose.yaml --env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args); \ @@ -154,7 +154,7 @@ cleandocker: ifdef pv # Remove unused volumes - docker volume ls -f name=$(MG_DOCKER_IMAGE_NAME_PREFIX) -f dangling=true -q | xargs -r docker volume rm + docker volume ls -f name=$(MG_DOCKER_VOLUME_NAME_PREFIX) -f dangling=true -q | xargs -r docker volume rm endif install: diff --git a/docker/README.md b/docker/README.md index 942a66e79..e5ff536d0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -22,7 +22,7 @@ To start additional addon services: docker compose -f docker/addons//docker-compose.yaml up ``` -To pull docker images from a specific release you need to change the value of `MG_RELEASE_TAG` in `.env` before running these commands. +To pull images from a specific release in `ghcr.io/absmach/magistrala`, change `MG_RELEASE_TAG` in `.env` before running these commands. ## Broker Configuration @@ -146,6 +146,7 @@ The included `Makefile` defines build and Docker‑build targets for all SuperMQ - `SERVICES`: list of core services (auth, clients, channels, http, coap, mqtt, ws, etc.) - `DOCKERS`, `DOCKERS_DEV`: build targets for production and development Docker images +- `make dockers`, `make dockers_dev`: always tag images as `ghcr.io/absmach/magistrala/` - Build arguments embed version, commit hash, and build timestamp into the binary diff --git a/docker/addons/bootstrap/docker-compose.yaml b/docker/addons/bootstrap/docker-compose.yaml index 88e3fcc7b..c96902f31 100644 --- a/docker/addons/bootstrap/docker-compose.yaml +++ b/docker/addons/bootstrap/docker-compose.yaml @@ -28,7 +28,7 @@ services: - magistrala-bootstrap-db-volume:/var/lib/postgresql/data bootstrap: - image: docker.io/magistrala/bootstrap:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/bootstrap:${MG_RELEASE_TAG} container_name: magistrala-bootstrap depends_on: - bootstrap-db diff --git a/docker/addons/postgres-reader/docker-compose.yaml b/docker/addons/postgres-reader/docker-compose.yaml index b3c34a2b5..0856a4fd3 100644 --- a/docker/addons/postgres-reader/docker-compose.yaml +++ b/docker/addons/postgres-reader/docker-compose.yaml @@ -13,7 +13,7 @@ networks: services: postgres-reader: - image: docker.io/magistrala/postgres-reader:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/postgres-reader:${MG_RELEASE_TAG} container_name: magistrala-postgres-reader restart: on-failure environment: diff --git a/docker/addons/postgres-writer/docker-compose.yaml b/docker/addons/postgres-writer/docker-compose.yaml index bf8b971af..1d3765873 100644 --- a/docker/addons/postgres-writer/docker-compose.yaml +++ b/docker/addons/postgres-writer/docker-compose.yaml @@ -32,7 +32,7 @@ services: - magistrala-postgres-writer-volume:/var/lib/postgresql/data postgres-writer: - image: docker.io/magistrala/postgres-writer:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/postgres-writer:${MG_RELEASE_TAG} container_name: magistrala-postgres-writer depends_on: - postgres diff --git a/docker/addons/provision/docker-compose.yaml b/docker/addons/provision/docker-compose.yaml index a3ab05be4..ba9a5690f 100644 --- a/docker/addons/provision/docker-compose.yaml +++ b/docker/addons/provision/docker-compose.yaml @@ -12,7 +12,7 @@ networks: services: provision: - image: docker.io/magistrala/provision:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/provision:${MG_RELEASE_TAG} container_name: magistrala-provision restart: on-failure networks: diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 7f889210a..b3ae64d10 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -111,7 +111,7 @@ services: command: ["redis-server", "/etc/redis/redis.conf"] auth: - image: docker.io/magistrala/auth:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/auth:${MG_RELEASE_TAG} container_name: magistrala-auth depends_on: - auth-db @@ -243,7 +243,7 @@ services: - magistrala-domains-redis-volume:/data domains: - image: docker.io/magistrala/domains:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/domains:${MG_RELEASE_TAG} container_name: magistrala-domains depends_on: - domains-db @@ -428,7 +428,7 @@ services: - magistrala-journal-volume:/var/lib/postgresql/data journal: - image: docker.io/magistrala/journal:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/journal:${MG_RELEASE_TAG} container_name: magistrala-journal depends_on: - journal-db @@ -571,7 +571,7 @@ services: - magistrala-clients-redis-volume:/data clients: - image: docker.io/magistrala/clients:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/clients:${MG_RELEASE_TAG} container_name: magistrala-clients depends_on: - clients-db @@ -766,7 +766,7 @@ services: - magistrala-channels-redis-volume:/data channels: - image: docker.io/magistrala/channels:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/channels:${MG_RELEASE_TAG} container_name: magistrala-channels depends_on: - channels-db @@ -950,7 +950,7 @@ services: - magistrala-users-db-volume:/var/lib/postgresql/data users: - image: docker.io/magistrala/users:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/users:${MG_RELEASE_TAG} container_name: magistrala-users depends_on: - users-db @@ -1089,7 +1089,7 @@ services: create_host_path: true notifications: - image: docker.io/magistrala/notifications:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/notifications:${MG_RELEASE_TAG} container_name: magistrala-notifications depends_on: - nginx @@ -1156,7 +1156,7 @@ services: - magistrala-groups-db-volume:/var/lib/postgresql/data groups: - image: docker.io/magistrala/groups:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/groups:${MG_RELEASE_TAG} container_name: magistrala-groups depends_on: - groups-db @@ -1387,7 +1387,7 @@ services: - magistrala-fluxmq-node3-volume:/tmp/fluxmq fluxmq-auth: - image: docker.io/magistrala/fluxmq:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/fluxmq:${MG_RELEASE_TAG} container_name: magistrala-fluxmq-auth restart: on-failure environment: @@ -1709,7 +1709,7 @@ services: - magistrala-timescale-writer-volume:/var/lib/postgresql/data timescale-reader: - image: docker.io/magistrala/timescale-reader:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/timescale-reader:${MG_RELEASE_TAG} container_name: magistrala-timescale-reader depends_on: - timescale @@ -1843,7 +1843,7 @@ services: create_host_path: true timescale-writer: - image: docker.io/magistrala/timescale-writer:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/timescale-writer:${MG_RELEASE_TAG} container_name: magistrala-timescale-writer depends_on: - timescale @@ -1892,7 +1892,7 @@ services: - magistrala-re-db-volume:/var/lib/postgresql/data re: - image: docker.io/magistrala/re:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/re:${MG_RELEASE_TAG} container_name: magistrala-re depends_on: - re-db @@ -2014,7 +2014,7 @@ services: - magistrala-alarms-db-volume:/var/lib/postgresql/data alarms: - image: docker.io/magistrala/alarms:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/alarms:${MG_RELEASE_TAG} container_name: magistrala-alarms depends_on: - alarms-db @@ -2115,7 +2115,7 @@ services: - magistrala-reports-db-volume:/var/lib/postgresql/data reports: - image: docker.io/magistrala/reports:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/reports:${MG_RELEASE_TAG} container_name: magistrala-reports depends_on: - reports-db @@ -2223,7 +2223,7 @@ services: - magistrala-base-net certs: - image: docker.io/magistrala/certs:${MG_RELEASE_TAG} + image: ghcr.io/absmach/magistrala/certs:${MG_RELEASE_TAG} container_name: magistrala-certs depends_on: openbao: