MVP Single Node with Manual Config in Docker
This commit is contained in:
commit
8212699f23
27 files changed
+3818
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# Контекст сборки — корень репозитория: в образ едет и демон health-check.
|
||||
FROM golang:1.23-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY hc/go.mod ./
|
||||
COPY hc/*.go ./
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/hcd .
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# openvswitch-switch — ovsdb-server и ovs-vswitchd; kmod — modprobe openvswitch;
|
||||
# curl — обращения к API демона из lbctl; остальное — диагностика стенда.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
openvswitch-switch \
|
||||
openvswitch-common \
|
||||
iproute2 \
|
||||
kmod \
|
||||
tcpdump \
|
||||
iputils-ping \
|
||||
conntrack \
|
||||
curl \
|
||||
procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=build /out/hcd /usr/local/bin/hcd
|
||||
COPY lb/topology.env lb/pipeline.sh lb/apply.sh lb/entrypoint.sh lb/lbctl.sh lb/hc-config.sh /opt/lb/
|
||||
RUN chmod +x /opt/lb/*.sh && ln -s /opt/lb/lbctl.sh /usr/local/bin/lbctl
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD ovs-ofctl -O OpenFlow15 dump-flows br-lb table=11 >/dev/null 2>&1 \
|
||||
&& curl -fsS --max-time 3 http://127.0.0.1:9111/status >/dev/null || exit 1
|
||||
|
||||
ENTRYPOINT ["/opt/lb/entrypoint.sh"]
|
||||
Reference in new issue
Block a user