[feat](build): add versioned Docker image build script and version injection

- Introduced `tools/build_server_image.sh` for building versioned server images with support for multi-arch builds.
- Added `VERSION` injection via `-ldflags` in Dockerfile and Go binaries for both server and client.
- Updated workflows and Makefile to ensure consistent version tagging during builds.
This commit is contained in:
dalbodeule
2025-12-09 18:41:00 +09:00
parent 3402616c3e
commit 1336c540d0
6 changed files with 63 additions and 3 deletions

View File

@@ -18,7 +18,9 @@ BIN_DIR := ./bin
SERVER_BIN := $(BIN_DIR)/hop-gate-server
CLIENT_BIN := $(BIN_DIR)/hop-gate-client
VERSION ?= $(shell git describe --tags --dirty --always 2>/dev/null || echo dev)
# VERSION 은 현재 커밋의 7글자 SHA 를 사용합니다 (예: 1a2b3c4).
# git 정보가 없으면 dev 로 fallback 합니다.
VERSION ?= $(shell git rev-parse --short=7 HEAD 2>/dev/null || echo dev)
# .env 파일 로드
include .env