-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.e2e
More file actions
41 lines (34 loc) · 1.31 KB
/
Dockerfile.e2e
File metadata and controls
41 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM golang:1.26
ENV GOPROXY="https://goproxy.cn,direct"
ENV LANG=C.UTF-8
ENV TZ=Asia/Shanghai
RUN set -eux; \
echo '' > /etc/apt/sources.list.d/debian.sources; \
echo 'deb http://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib' > /etc/apt/sources.list; \
echo 'deb http://mirrors.aliyun.com/debian-security/ bookworm-security main' >> /etc/apt/sources.list; \
echo 'deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib' >> /etc/apt/sources.list; \
apt-get update; \
apt-get install -y --no-install-recommends \
ipvsadm \
iptables \
kmod \
iproute2 \
tzdata \
; \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Cache dependencies first
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY cmd/ cmd/
COPY pkg/ pkg/
COPY tests/ tests/
COPY Makefile Makefile
# Entrypoint: load IPVS kernel modules inside the container (works on both
# Linux hosts and macOS Docker Desktop, which runs a Linux VM with IPVS built-in),
# then hand off to the test command.
COPY tests/e2e/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["sh", "-c", "make test-linux && make test-e2e"]