-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cli
More file actions
71 lines (55 loc) · 2.49 KB
/
Dockerfile.cli
File metadata and controls
71 lines (55 loc) · 2.49 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Multi-stage build for streamstress CLI container image.
# Runtime image includes full toolchain: oc, ko, go, git, gauge, opc, tar.
# --- Build stage ---
FROM registry.access.redhat.com/ubi9/ubi:latest AS builder
RUN dnf install -y gcc make openssl-devel && dnf clean all
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /build
COPY Cargo.toml Cargo.lock* ./
COPY src/ src/
COPY config/components.toml config/
RUN cargo build --release
# --- Runtime stage ---
FROM registry.access.redhat.com/ubi9/ubi:latest
RUN dnf install -y \
git \
tar \
gzip \
wget \
unzip \
jq \
&& dnf clean all
# Install oc CLI
RUN wget -q https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz \
&& tar xzf openshift-client-linux.tar.gz -C /usr/local/bin oc kubectl \
&& rm -f openshift-client-linux.tar.gz
# Install Go (must match release-tests go.mod toolchain to avoid runtime GOTOOLCHAIN download)
RUN wget -q https://go.dev/dl/go1.24.13.linux-amd64.tar.gz \
&& tar xzf go1.24.13.linux-amd64.tar.gz -C /usr/local \
&& rm -f go1.24.13.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:/root/go/bin:${PATH}"
# Install ko
RUN go install github.com/google/ko@latest
# Install gauge and required plugins
RUN wget -q https://github.com/getgauge/gauge/releases/download/v1.6.3/gauge-1.6.3-linux.x86_64.zip \
&& unzip -q gauge-1.6.3-linux.x86_64.zip -d /usr/local/bin \
&& rm -f gauge-1.6.3-linux.x86_64.zip \
&& gauge install go \
&& gauge install xml-report
# Install opc (OpenShift Pipelines CLI)
RUN wget -q https://mirror.openshift.com/pub/openshift-v4/clients/pipelines/latest/tkn-linux-amd64.tar.gz \
&& tar xzf tkn-linux-amd64.tar.gz -C /usr/local/bin opc 2>/dev/null || true \
&& tar xzf tkn-linux-amd64.tar.gz -C /usr/local/bin tkn 2>/dev/null || true \
&& rm -f tkn-linux-amd64.tar.gz
# Copy CLI binary from build stage
COPY --from=builder /build/target/release/streamstress /usr/local/bin/streamstress
COPY config/components.toml /etc/streamstress/components.toml
# Copy CI scripts for auto-publish
COPY scripts/publish-to-gh-pages.sh /usr/local/bin/publish-to-gh-pages.sh
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/publish-to-gh-pages.sh /usr/local/bin/entrypoint.sh
ENV STREAMSTRESS_INCLUSTER=1
# Entrypoint wrapper: runs streamstress, then publishes if configured
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]