Files
EvoBGP/deploy/docker
Denozordec a37c931ee7
CI / changes (push) Successful in 10s
CI / commitlint (push) Has been skipped
CI / openapi (push) Successful in 27s
CI / web (push) Successful in 38s
CI / go (push) Successful in 2m36s
CI / bird2 (push) Successful in 15s
CI / release (push) Failing after 3m7s
feat(monorepo): restructure web components and update configurations
Refactored the project structure to support a monorepo setup, moving the web application to `apps/web/` and updating related configurations. Adjusted pre-commit hooks to use `pnpm` for linting and formatting. Updated CI workflows to reflect the new directory structure and dependencies. Removed legacy files and configurations from the previous `web/` directory, streamlining the project for better maintainability and clarity.
2026-06-30 23:54:28 +07:00
..

Docker-образы EvoBGP

CI (Gitea Actions)

Сборка образов — docker buildx bake (deploy/docker/docker-bake.hcl), не отдельные docker build.

Publish: push в main после quality gates — job release в .gitea/workflows/ci.yaml: semantic-release + bake с VERSION из релиза.

Локально BuildKit также кэширует /go/pkg/mod и ~/.cache/go-build через RUN --mount=type=cache.

Было Стало
8× go mod download + 8× go build (разные BIN) 1× download + 1× компиляция всех cmd/*
2× сборка BIRD из исходников (api, all) 1× stage birdc, копируется в runtime
2× npm ci (web, web-all) 1× web-deps + 1× web-build + два nginx-образа (общий артефакт)
8 runner'ов с checkout/login 1 job docker-go, 1 job docker-web

Кэш registry (переменные bake):

  • git.shts.su/<owner>/evobgp-buildcache:go-buildcacheзапись только из target go-build-all
  • git.shts.su/<owner>/evobgp-buildcache:web-buildcacheзапись только из target web-build

Остальные bake-target’ы только cache-from (чтение). Параллельный cache-to в один ref ломает manifest в registry (content descriptor … not found).

Локально BuildKit также кэширует /go/pkg/mod и ~/.cache/go-build через RUN --mount=type=cache.

Если CI падает на «not found» после смены схемы кэша — один раз удалите теги evobgp-buildcache:go-buildcache и :web-buildcache в registry и пересоберите.

Локальная сборка

Из корня репозитория:

cd deploy/docker
export REGISTRY=git.shts.su/<owner>
export IMAGE_TAG=latest
export SHORT_SHA=$(git rev-parse --short HEAD)
export VERSION=dev
export BUILD_TIME=
sh write-bake-override.sh
docker buildx bake --allow=fs.read=../.. -f docker-bake.hcl -f docker-bake.override.hcl go-images
docker buildx bake --allow=fs.read=../.. -f docker-bake.hcl -f docker-bake.override.hcl web-images

В docker-bake.hcl: context = "../.." (корень репо), dockerfile = "deploy/docker/…" (путь от корня репо). CI: write-bake-override.sh + --allow=fs.read=$GITHUB_WORKSPACE в .gitea/workflows/ci.yaml.

Один образ (legacy):

docker build -f deploy/docker/gobinary/Dockerfile \
  --target build-all \
  --build-arg BIN=evobgp-api \
  -t evobgp-api:local .

Runtime-образы в bake ожидают stage build-all (через bake contexts), не отдельный --build-arg BIN на старый target build.