feat: update CI configuration and Dockerfiles for improved build efficiency
CI / changes (push) Successful in 7s
CI / openapi (push) Has been skipped
CI / go (push) Successful in 1m29s
CI / docker-web (push) Failing after 15s
CI / docker-bird (push) Failing after 14s
CI / bird2 (push) Successful in 14s
CI / docker-go (push) Failing after 14s

Enhanced the CI workflow by adding support for docker-bake.hcl to streamline the building and pushing of Go images. Updated Go version to 1.24 and introduced caching for Go module dependencies. Refactored Dockerfiles for evobgp-agent, evobgp-web, and gobinary to utilize build stages more effectively, improving caching and build performance. Adjusted installation commands and entry points for better clarity and maintainability.
This commit is contained in:
Denozordec
2026-05-19 10:44:24 +07:00
parent 7a2b015b12
commit 80229b33fc
6 changed files with 349 additions and 204 deletions
+6 -15
View File
@@ -1,19 +1,10 @@
# evobgp-agent + bird2 из репозитория Ubuntu Noble (тот же стек, что evobgp-bird2).
# См. gobinary/Dockerfile — ECR Public вместо прямого pull с Docker Hub.
# Порядок слоёв как в gobinary: кэш модулей отдельно от исходников (CI/CD BuildKit).
FROM public.ecr.aws/docker/library/golang:1.24-bookworm AS deps
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
FROM deps AS build
COPY . .
RUN go build -trimpath -ldflags="-s -w" -o /out/evobgp-agent ./cmd/evobgp-agent
# syntax=docker/dockerfile:1.7
# Агент: бинарь из общего build-all (docker-bake.hcl → contexts.build-all), bird2 из apt.
FROM public.ecr.aws/docker/library/ubuntu:noble
RUN apt-get update \
&& apt-get install -y --no-install-recommends bird2 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /out/evobgp-agent /usr/local/bin/evobgp-agent
&& apt-get install -y --no-install-recommends bird2 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ARG BIN=evobgp-agent
COPY --from=build-all /out/${BIN} /usr/local/bin/evobgp-agent
WORKDIR /etc/bird
ENTRYPOINT ["/usr/local/bin/evobgp-agent"]