Skip to content

Commit 60f6c5b

Browse files
authored
Updated Docker build files so they are working again (#436)
* Updated README.md * Squash merge feature/update-docker-image into master * Install vim on the openmessaging image * Start shell by default * Start shell by default also for Dockerfile.build * Use eclipse-temurin:17, fix apt install, and document image tagging\n\n- Switch base images to eclipse-temurin:17 for best practice\n- Remove version pinning for vim/tzdata to avoid apt errors\n- Update README to show -t usage and new image names\n- Prevent dangling images by tagging in build commands
1 parent b10b227 commit 60f6c5b

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# OpenMessaging Benchmark Framework
1+
# Fork of the OpenMessaging Benchmark Framework that uses sapmachine 17 docker image
2+
3+
This fork is used to update the outdated offical docker hub image openmessaging/openmessaging-benchmark with sapmachine:17.
4+
Find more in [./docker/README.md](./docker/README.md).
25

36
[![Build](https://github.com/openmessaging/benchmark/actions/workflows/pr-build-and-test.yml/badge.svg)](https://github.com/openmessaging/benchmark/actions/workflows/pr-build-and-test.yml)
47
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
@@ -27,7 +30,7 @@ This repository houses user-friendly, cloud-ready benchmarking suites for the fo
2730

2831
Requirements:
2932

30-
* JDK 8
33+
* JDK 17
3134
* Maven 3.8.6+
3235

3336
Common build actions:

docker/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212
# limitations under the License.
1313
#
1414

15-
FROM openjdk:8-jdk
15+
FROM eclipse-temurin:17
1616

1717
ARG BENCHMARK_TARBALL
1818

19+
# Using ADD instead of COPY because ${BENCHMARK_TARBALL} is an archive that needs to be extracted
1920
ADD ${BENCHMARK_TARBALL} /
2021

2122
RUN mv openmessaging-benchmark-* /benchmark
2223

2324
WORKDIR /benchmark
25+
26+
# Install vim
27+
ENV DEBIAN_FRONTEND=noninteractive
28+
RUN apt-get update && apt-get install -y vim tzdata && rm -rf /var/lib/apt/lists/*
29+
30+
# Start a shell by default
31+
CMD ["/bin/bash"]

docker/Dockerfile.build

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313
#
1414

1515
# Build the Project
16-
FROM maven:latest as build
16+
FROM maven:3.9.9-eclipse-temurin-17 as build
1717
COPY . /benchmark
1818
WORKDIR /benchmark
1919
RUN mvn install
2020

2121
# Create the benchmark image
22-
FROM openjdk:8-jdk
22+
FROM eclipse-temurin:17
2323
COPY --from=build /benchmark/package/target/openmessaging-benchmark-*-SNAPSHOT-bin.tar.gz /
2424
RUN mkdir /benchmark && tar -xzf openmessaging-benchmark-*-SNAPSHOT-bin.tar.gz -C /benchmark --strip=1
2525
RUN rm /openmessaging-benchmark-*-SNAPSHOT-bin.tar.gz
26-
WORKDIR /benchmark
26+
WORKDIR /benchmark
27+
28+
# Install vim
29+
ENV DEBIAN_FRONTEND=noninteractive
30+
RUN apt-get update && apt-get install -y vim tzdata && rm -rf /var/lib/apt/lists/*
31+
32+
# Start a shell by default
33+
CMD ["/bin/bash"]

docker/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
# OpenMessaging Benchmark Framework Docker
22

3+
## Precondition
4+
5+
You need to install [Eclipse Temurin 17](https://adoptium.net/)
6+
and set the JAVA_HOME environment variable to its installation directory.
7+
8+
## Building the image
9+
310
You can use either of the Dockerfiles - `./docker/Dockerfile` or `./docker/Dockerfile.build` based on your needs.
411

512
### `Dockerfile`
613

7-
Uses `openjdk-8` and takes `BENCHMARK_TARBALL` as an argument.
14+
Uses `eclipse-temurin:17` and takes `BENCHMARK_TARBALL` as an argument.
815
While using this Dockerfile, you will need to build the project locally **first**.
916

1017
```
1118
#> mvn build
1219
#> export BENCHMARK_TARBALL=package/target/openmessaging-benchmark-<VERSION>-SNAPSHOT-bin.tar.gz
13-
#> docker build --build-arg BENCHMARK_TARBALL . -f docker/Dockerfile
20+
#> docker build -t openmessaging-benchmark:latest --build-arg BENCHMARK_TARBALL . -f docker/Dockerfile
1421
```
1522

1623
### `Dockerfile.build`
1724

18-
Uses the latest version of `maven` in order to build the project, and then use `openjdk-8` as runtime.
19-
This Dockerfile has no dependency (you do not need Mavent to be installed locally).
25+
Uses the latest version of `maven` in order to build the project, and then uses `eclipse-temurin:17` as runtime.
26+
This Dockerfile has no dependency (you do not need Maven to be installed locally).
2027

2128
```
22-
#> docker build . -f docker/Dockerfile.build
29+
#> docker build -t openmessaging-benchmark:latest . -f docker/Dockerfile.build
2330
```
2431

0 commit comments

Comments
 (0)