Skip to content

Commit 3945526

Browse files
authored
Merge pull request #20643 from nwnt/reduce-etcd-imagesize-antithesis
Reduce the antithesis docker image footprint
2 parents dc6ec53 + 9188973 commit 3945526

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/antithesis/server/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG GO_VERSION=1.24.6
22
ARG ARCH=amd64
33

4-
FROM golang:$GO_VERSION
4+
FROM golang:$GO_VERSION AS build
55

66
# cloning etcd
77
ARG REF=main
@@ -39,7 +39,6 @@ RUN cp -r /etcd_instrumented/symbols/* /symbols
3939

4040
EXPOSE 2379 2380
4141

42-
# start etcd server
4342
WORKDIR /etcd_instrumented/customer
4443

4544
# Some previous versions hardcode CGO_ENABLED=0
@@ -54,4 +53,8 @@ RUN for d in server etcdutl etcdctl; do (cd ${d} && go mod tidy || true); done
5453
# The instrumentation also adds a new main file which clashes with dummy.go found in non release-3.4 branches
5554
RUN if [ -f "dummy.go" ]; then sed -i 's/package main_test/package main/' dummy.go; fi
5655
RUN CGO_ENABLED=1 make build
57-
CMD ["./bin/etcd"]
56+
57+
FROM ubuntu:24.04
58+
COPY --from=build /etcd_instrumented/ /etcd
59+
60+
CMD ["/etcd/customer/bin/etcd"]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG GO_VERSION=1.24.6
22
ARG ARCH=amd64
33

4-
FROM golang:$GO_VERSION
4+
FROM golang:$GO_VERSION AS build
55
ARG CFG_NODE_COUNT=3
66
WORKDIR /build
77
COPY . .
@@ -10,3 +10,6 @@ WORKDIR /build/tests
1010
RUN go build -ldflags "-X main.NodeCount=$CFG_NODE_COUNT" -o /opt/antithesis/entrypoint/entrypoint -race ./antithesis/test-template/entrypoint/main.go
1111
RUN go build -ldflags "-X main.NodeCount=$CFG_NODE_COUNT" -o /opt/antithesis/test/v1/robustness/singleton_driver_traffic -race ./antithesis/test-template/robustness/traffic/main.go
1212
RUN go build -ldflags "-X main.NodeCount=$CFG_NODE_COUNT" -o /opt/antithesis/test/v1/robustness/finally_validation -race ./antithesis/test-template/robustness/finally/main.go
13+
14+
FROM ubuntu:24.04
15+
COPY --from=build /opt/ /opt/

0 commit comments

Comments
 (0)