Skip to content

Commit e5dcd08

Browse files
committed
bumped
1 parent d91880f commit e5dcd08

1 file changed

Lines changed: 230 additions & 120 deletions

File tree

Dockerfile

Lines changed: 230 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,271 @@
1-
FROM ubuntu:latest as build
1+
FROM ubuntu:24.04 AS build
22
ENV DEBIAN_FRONTEND=noninteractive
3-
RUN set +ex && \
4-
apt update && \
5-
apt dist-upgrade -y && \
6-
apt install -y autoconf automake autotools-dev binutils build-essential cython cython3 g++ git libc-ares-dev libcunit1-dev libev4 libev-dev libevent-dev libjansson-dev libjemalloc-dev libspdylay-dev libssl-dev libsystemd-dev libtool libxml2-dev make pkg-config python3.8-dev python3.8-distutils python3-dev python3-setuptools python-setuptools zlib1g-dev
7-
RUN set +ex && \
8-
git clone https://github.com/nghttp2/nghttp2.git && \
9-
cd nghttp2 && \
10-
git submodule update --init
11-
RUN set +ex && \
12-
cd nghttp2 && \
13-
autoreconf -i && \
14-
automake && \
15-
autoconf && \
16-
./configure --enable-app PYTHON_VERSION=3.8 && \
17-
make -j $(nproc)
18-
19-
FROM ubuntu:latest as packetdrill
3+
4+
# Install base build tools first (cacheable layer)
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends \
7+
git gcc g++ make binutils autoconf automake autotools-dev libtool \
8+
pkg-config ca-certificates && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
# Install cmake separately (often changes)
12+
RUN apt-get update && \
13+
apt-get install -y --no-install-recommends cmake cmake-data && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
# Install nghttp2 dependencies
17+
RUN apt-get update && \
18+
apt-get install -y --no-install-recommends \
19+
zlib1g-dev libev-dev libjemalloc-dev libc-ares-dev libssl-dev \
20+
libsystemd-dev libevent-dev libjansson-dev libxml2-dev python3-dev \
21+
libbrotli-dev && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
# Clone nghttp2 (separate step for better caching)
25+
RUN git clone --depth 1 -b v1.64.0 https://github.com/nghttp2/nghttp2.git
26+
27+
# Build nghttp2 with minimal features for speed
28+
RUN cd nghttp2 && \
29+
git submodule update --init --depth 1 && \
30+
autoreconf -i && \
31+
./configure --enable-app \
32+
--disable-examples \
33+
--disable-hpack-tools \
34+
--disable-python-bindings \
35+
--disable-static \
36+
--disable-failmalloc \
37+
--disable-threads \
38+
CFLAGS="-O2" CXXFLAGS="-O2" && \
39+
make -j$(nproc) && \
40+
make install-strip && \
41+
ldconfig
42+
43+
FROM ubuntu:24.04 AS packetdrill
2044
ENV DEBIAN_FRONTEND=noninteractive
21-
RUN set +ex && \
22-
apt update && \
23-
apt dist-upgrade -y && \
24-
apt install -y git bison flex binutils build-essential && \
25-
git clone https://github.com/google/packetdrill.git && \
26-
cd packetdrill/gtests/net/packetdrill && \
27-
./configure && \
28-
make -j $(nproc)
29-
30-
FROM ubuntu:latest as h2o-quicly
45+
46+
# Install CA certificates first
47+
RUN apt-get update && \
48+
apt-get install -y --no-install-recommends ca-certificates && \
49+
rm -rf /var/lib/apt/lists/*
50+
51+
# Install build tools
52+
RUN apt-get update && \
53+
apt-get install -y --no-install-recommends \
54+
git bison flex binutils build-essential && \
55+
rm -rf /var/lib/apt/lists/*
56+
57+
# Clone and build packetdrill
58+
RUN git clone --depth 1 https://github.com/google/packetdrill.git && \
59+
cd packetdrill/gtests/net/packetdrill && \
60+
./configure && \
61+
make -j$(nproc)
62+
63+
FROM ubuntu:24.04 AS h2o-quicly
3164
ENV DEBIAN_FRONTEND=noninteractive
32-
RUN set +ex && \
33-
apt update && \
34-
apt dist-upgrade -y && \
35-
apt install -y git binutils build-essential autoconf automake autotools-dev binutils cmake libssl-dev && \
36-
git clone https://github.com/h2o/quicly.git && cd quicly && \
37-
git submodule update --init --recursive && \
38-
cmake . && \
39-
make -j $(nproc)
65+
66+
# Install base tools first
67+
RUN apt-get update && \
68+
apt-get install -y --no-install-recommends \
69+
ca-certificates git binutils build-essential && \
70+
rm -rf /var/lib/apt/lists/*
71+
72+
# Install cmake and dependencies
73+
RUN apt-get update && \
74+
apt-get install -y --no-install-recommends \
75+
autoconf automake autotools-dev cmake libssl-dev && \
76+
rm -rf /var/lib/apt/lists/*
77+
78+
# Clone and build quicly (build only cli target to avoid simulator segfault)
79+
RUN git clone --depth 1 https://github.com/h2o/quicly.git && \
80+
cd quicly && \
81+
git submodule update --init --recursive --depth 1 && \
82+
cmake . -DCMAKE_BUILD_TYPE=Release && \
83+
make cli -j2
4084

4185

4286

4387

44-
FROM ubuntu:latest as oatpp
88+
FROM ubuntu:24.04 AS oatpp
4589
ENV DEBIAN_FRONTEND=noninteractive
46-
RUN set +ex && \
47-
apt update && \
48-
apt dist-upgrade -y && \
49-
apt install -y cmake build-essential git tree vim
5090

51-
RUN set +ex && \
52-
git clone https://github.com/oatpp/benchmark-websocket.git && \
53-
cd benchmark-websocket && \
54-
sed 's/\<make\>/make -j $(nproc)/g' -i prepare.sh && \
55-
bash prepare.sh && \
56-
cd server/build/ && \
57-
cmake .. && \
58-
make -j $(nproc) && \
59-
cd - && \
60-
cd client/build/ && \
61-
cmake .. && \
62-
make -j $(nproc)
91+
# Install build tools separately for caching
92+
RUN apt-get update && \
93+
apt-get install -y --no-install-recommends \
94+
ca-certificates git build-essential && \
95+
rm -rf /var/lib/apt/lists/*
6396

97+
RUN apt-get update && \
98+
apt-get install -y --no-install-recommends cmake && \
99+
rm -rf /var/lib/apt/lists/*
64100

101+
# Clone and build oatpp benchmark
102+
# First install oatpp base library
103+
RUN git clone --depth 1 https://github.com/oatpp/oatpp.git && \
104+
cd oatpp && \
105+
mkdir build && cd build && \
106+
cmake .. -DCMAKE_BUILD_TYPE=Release -DOATPP_BUILD_TESTS=OFF && \
107+
make -j$(nproc) && \
108+
make install && \
109+
cd ../.. && rm -rf oatpp
65110

66-
FROM rust:1.53.0 as oha
67-
RUN set +ex && \
68-
cargo install oha
111+
# Then build oatpp-websocket
112+
RUN git clone --depth 1 https://github.com/oatpp/oatpp-websocket.git && \
113+
cd oatpp-websocket && \
114+
mkdir build && cd build && \
115+
cmake .. -DCMAKE_BUILD_TYPE=Release -DOATPP_BUILD_TESTS=OFF && \
116+
make -j$(nproc) && \
117+
make install && \
118+
cd ../.. && rm -rf oatpp-websocket
69119

70-
FROM rust:1.53.0 as drill
71-
RUN set +ex && \
72-
cargo install drill
120+
# Finally build the benchmark
121+
RUN git clone --depth 1 https://github.com/oatpp/benchmark-websocket.git && \
122+
cd benchmark-websocket && \
123+
cd server && \
124+
mkdir build && cd build && \
125+
cmake .. -DCMAKE_BUILD_TYPE=Release && \
126+
make -j$(nproc) && \
127+
cd ../../client && \
128+
mkdir build && cd build && \
129+
cmake .. -DCMAKE_BUILD_TYPE=Release && \
130+
make -j$(nproc)
73131

74-
FROM rust:1.53.0 as feroxbuster
75-
RUN set +ex && \
76-
cargo install feroxbuster
77132

78-
FROM golang:1.16.6-buster as bombardier
79-
RUN set +ex && \
80-
go get -u github.com/codesenberg/bombardier
81133

82-
FROM golang:1.15-buster as ethr
83-
RUN set +ex && \
84-
apt update && apt install -y git && \
85-
git clone https://github.com/Microsoft/ethr.git && \
86-
cd ethr && \
87-
mkdir /out && \
88-
go build . && \
89-
pwd && ls -alh
90-
91-
FROM golang:1.16.6-buster as fasthttploader
92-
RUN set +ex && \
93-
go get github.com/hagen1778/fasthttploader
134+
FROM ubuntu:24.04 AS oha
135+
RUN apt-get update && apt-get install -y --no-install-recommends \
136+
ca-certificates curl && \
137+
curl -L https://github.com/hatoo/oha/releases/download/v1.4.5/oha-linux-amd64 -o /usr/local/bin/oha && \
138+
chmod +x /usr/local/bin/oha
94139

95-
FROM golang:1.16.6-buster as goloris
96-
RUN set +ex && \
97-
go get github.com/valyala/goloris
140+
FROM ubuntu:24.04 AS drill
141+
RUN apt-get update && apt-get install -y --no-install-recommends \
142+
ca-certificates curl && \
143+
curl -L https://github.com/fcsonline/drill/releases/download/0.8.3/drill-x86_64-unknown-linux-gnu -o /usr/local/bin/drill && \
144+
chmod +x /usr/local/bin/drill
98145

146+
FROM ubuntu:24.04 AS feroxbuster
147+
RUN apt-get update && apt-get install -y --no-install-recommends \
148+
ca-certificates curl unzip && \
149+
curl -L https://github.com/epi052/feroxbuster/releases/download/v2.10.4/x86_64-linux-feroxbuster.zip -o feroxbuster.zip && \
150+
unzip feroxbuster.zip -d /usr/local/bin && \
151+
chmod +x /usr/local/bin/feroxbuster && \
152+
rm feroxbuster.zip
99153

100-
FROM golang:1.16.6-buster as hey
101-
RUN set +ex && \
102-
go get github.com/rakyll/hey
154+
FROM ubuntu:24.04 AS bombardier
155+
RUN apt-get update && apt-get install -y --no-install-recommends \
156+
ca-certificates curl && \
157+
curl -L https://github.com/codesenberg/bombardier/releases/download/v1.2.6/bombardier-linux-amd64 -o /usr/local/bin/bombardier && \
158+
chmod +x /usr/local/bin/bombardier
159+
160+
FROM ubuntu:24.04 AS ethr
161+
RUN apt-get update && apt-get install -y --no-install-recommends \
162+
ca-certificates wget unzip && \
163+
wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip && \
164+
unzip ethr_linux.zip && \
165+
chmod +x ethr && \
166+
mv ethr /usr/local/bin/
167+
168+
# fasthttploader removed
103169

104-
FROM golang:1.16.6-buster as pandora
170+
FROM golang:1.13-buster AS goloris
105171
RUN set +ex && \
106-
apt update && apt install -y git && \
107-
git clone https://github.com/yandex/pandora.git && \
108-
cd pandora && \
109-
make deps && \
110-
go install
172+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go get -u github.com/valyala/goloris
111173

112-
FROM ubuntu:latest
174+
FROM ubuntu:24.04 AS hey
175+
RUN apt-get update && apt-get install -y --no-install-recommends \
176+
ca-certificates curl && \
177+
curl -L https://hey-release.s3.us-east-2.amazonaws.com/hey_linux_amd64 -o /usr/local/bin/hey && \
178+
chmod +x /usr/local/bin/hey
179+
180+
FROM golang:1.23-bookworm AS pandora
181+
RUN apt-get update && apt-get install -y --no-install-recommends git make && \
182+
git clone --depth 1 https://github.com/yandex/pandora.git && \
183+
cd pandora && \
184+
go mod download && \
185+
go build -o /go/bin/pandora .
186+
187+
FROM ubuntu:24.04 AS tools
113188
ENV DEBIAN_FRONTEND=noninteractive
114-
RUN set -ex \
115-
apt-get update && apt-get dist-upgrade -y && \
116-
apt-get update && \
117-
apt-get install -y git nmap curl wget apache2-utils libjemalloc-dev libev4 libssl-dev python3-pip strace iperf tree && \
118-
pip3 install httpstat && \
119-
wget -qP /usr/local/bin/rustbuster https://github.com/phra/rustbuster/releases/download/$(curl -s https://github.com/phra/rustbuster/releases | grep "rustbuster-v" | head -n1 | cut -d'/' -f6)/rustbuster-$(curl -s https://github.com/phra/rustbuster/releases | grep "rustbuster-v" | head -n1 | cut -d'/' -f6)-x86_64-unknown-linux-gnu && \
120-
#python3-pip
121-
rm -rf /var/lib/apt/lists/*
122-
123-
#http load generators
124-
COPY --from=build /nghttp2/ /nghttp2/
125-
COPY --from=oha /usr/local/cargo/bin/oha /usr/local/bin/oha
126-
COPY --from=drill /usr/local/cargo/bin/drill /usr/local/bin/drill
127-
COPY --from=bombardier /go/bin/bombardier /usr/local/bin/bombardier
128-
COPY --from=fasthttploader /go/bin/fasthttploader /usr/local/bin/fasthttploader
189+
190+
# Copy all tools into this stage
191+
COPY --from=build /usr/local/bin/h2load /usr/local/bin/h2load
192+
COPY --from=build /usr/local/bin/nghttp /usr/local/bin/nghttp
193+
COPY --from=build /usr/local/bin/nghttpd /usr/local/bin/nghttpd
194+
COPY --from=build /usr/local/bin/nghttpx /usr/local/bin/nghttpx
195+
COPY --from=oha /usr/local/bin/oha /usr/local/bin/oha
196+
COPY --from=drill /usr/local/bin/drill /usr/local/bin/drill
197+
COPY --from=bombardier /usr/local/bin/bombardier /usr/local/bin/bombardier
129198
COPY --from=goloris /go/bin/goloris /usr/local/bin/goloris
130-
COPY --from=hey /go/bin/hey /usr/local/bin/hey
199+
COPY --from=hey /usr/local/bin/hey /usr/local/bin/hey
131200
COPY --from=pandora /go/bin/pandora /usr/local/bin/pandora
132-
COPY --from=pandora /go/pandora /pandora
133201
COPY --from=h2o-quicly /quicly /quicly
134-
#ab
135-
136-
#dir busters
137-
COPY --from=feroxbuster /usr/local/cargo/bin/feroxbuster /usr/local/bin/feroxbuster
138-
#rustbuster
139-
140-
#packet generators
141-
COPY --from=ethr /go/ethr/ethr /usr/local/bin/ethr
202+
COPY --from=feroxbuster /usr/local/bin/feroxbuster /usr/local/bin/feroxbuster
203+
COPY --from=ethr /usr/local/bin/ethr /usr/local/bin/ethr
142204
COPY --from=packetdrill /packetdrill /packedrill
143-
#ws
144205
COPY --from=oatpp /benchmark-websocket/ /benchmark-websocket/
145206

146-
WORKDIR /nghttp2/src
207+
# Download additional tools
208+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && \
209+
wget -q https://github.com/phra/rustbuster/releases/download/v3.0.3/rustbuster-v3.0.3-x86_64-unknown-linux-gnu -O /usr/local/bin/rustbuster && \
210+
chmod +x /usr/local/bin/rustbuster || true && \
211+
rm -rf /var/lib/apt/lists/*
212+
213+
FROM ubuntu:24.04 AS test
214+
ENV DEBIAN_FRONTEND=noninteractive
215+
216+
# Install runtime dependencies
217+
RUN apt-get update && \
218+
apt-get install -y --no-install-recommends \
219+
libjemalloc-dev libev4 libssl3 ca-certificates && \
220+
rm -rf /var/lib/apt/lists/*
221+
222+
# Copy all tools from tools stage
223+
COPY --from=tools /usr/local/bin/ /usr/local/bin/
224+
COPY --from=tools /quicly /quicly
225+
COPY --from=tools /packedrill /packedrill
226+
COPY --from=tools /benchmark-websocket/ /benchmark-websocket/
227+
228+
# Test all tools
229+
WORKDIR /
147230
RUN set +ex && \
148-
./h2load -h && \
231+
echo "==============h2load==============" && \
232+
h2load -h && \
233+
echo "==============oha==============" && \
149234
oha --version && \
150-
fasthttploader --help && \
235+
echo "==============goloris==============" && \
151236
goloris --help && \
237+
echo "==============hey==============" && \
152238
hey --help && \
239+
echo "==============drill==============" && \
153240
drill --version && \
241+
echo "==============bombardier==============" && \
154242
bombardier --version && \
243+
echo "==============pandora==============" && \
155244
pandora --version
156245

157-
WORKDIR /
246+
FROM ubuntu:24.04
247+
ENV DEBIAN_FRONTEND=noninteractive
248+
249+
# Install all runtime dependencies
250+
RUN apt-get update && \
251+
apt-get install -y --no-install-recommends \
252+
git nmap curl wget apache2-utils libjemalloc-dev libev4 libssl3 \
253+
python3-pip pipx strace iperf tree ca-certificates && \
254+
pipx install httpstat && \
255+
rm -rf /var/lib/apt/lists/*
256+
257+
# Make pipx binaries available in PATH
258+
ENV PATH="/root/.local/bin:${PATH}"
158259

260+
# Copy all tools from tools stage
261+
COPY --from=tools /usr/local/bin/ /usr/local/bin/
262+
COPY --from=tools /quicly /quicly
263+
COPY --from=tools /packedrill /packedrill
264+
COPY --from=tools /benchmark-websocket/ /benchmark-websocket/
265+
266+
# Install trivy for security scanning
159267
RUN set +ex && \
160268
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin && \
161269
trivy filesystem --exit-code 0 -f json -o /results.json --no-progress /
270+
271+
WORKDIR /

0 commit comments

Comments
 (0)