forked from kroxylicious/kroxylicious
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
38 lines (29 loc) · 1.44 KB
/
Containerfile
File metadata and controls
38 lines (29 loc) · 1.44 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
#
# Copyright Kroxylicious Authors.
#
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
#
# Multi-stage build for OpenMessaging Benchmark (OMB).
# The published openmessaging/openmessaging-benchmark:latest image ships
# Kafka client 1.0.0 on Java 8. This Containerfile builds from the
# current upstream source (Kafka 3.6.1, JDK 21).
# Upstream OMB has no tags or releases — pin to a known-good commit on master.
ARG OMB_COMMIT=85599891321cafa2fb7065a63f009b4bb5374288
# ---------- Stage 1: build ----------
FROM registry.access.redhat.com/ubi9/openjdk-21:1.24-2.1775561374@sha256:3a0161bc68944f82800fa8a3873508343a6a16a0b0211107c4d97adb1c464a1c AS builder
USER root
ARG OMB_COMMIT
RUN microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y git && \
microdnf clean all
RUN git clone https://github.com/openmessaging/benchmark.git /build && \
cd /build && git checkout ${OMB_COMMIT}
WORKDIR /build
RUN mvn clean package -DskipTests && \
mkdir -p /opt/benchmark && \
tar -xzf /build/package/target/openmessaging-benchmark-*-bin.tar.gz --strip-components=1 -C /opt/benchmark
# ---------- Stage 2: runtime ----------
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24-2.1774011801@sha256:622ba9ba5339b3af9bd4fd4bb9aad4d199ff3e2d0d1e50500d113aac38a801bf
USER root
COPY --from=builder --chown=185:0 /opt/benchmark /opt/benchmark
USER 185
WORKDIR /opt/benchmark