|
1 |
| -FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS cross-builder |
2 |
| -ENV BUILD_BASE=/tmp/build-extra |
3 |
| - |
4 |
| -# Install dependencies |
5 |
| -RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ |
6 |
| - apt-get install -y --no-install-recommends \ |
7 |
| - ca-certificates \ |
8 |
| - wget \ |
9 |
| - patch \ |
10 |
| - libdigest-sha-perl \ |
11 |
| - libc6-dev-riscv64-cross \ |
12 |
| - gcc-12-riscv64-linux-gnu \ |
13 |
| - && \ |
14 |
| - adduser developer -u 499 --gecos ",,," --disabled-password && \ |
15 |
| - mkdir -p ${BUILD_BASE} && chown -R developer:developer ${BUILD_BASE} && \ |
16 |
| - rm -rf /var/lib/apt/lists/* |
17 |
| - |
18 |
| -USER developer |
19 |
| -WORKDIR ${BUILD_BASE} |
20 |
| - |
21 |
| -# Build benchmark binaries |
22 |
| -COPY fs/dhrystone.patch ${BUILD_BASE}/ |
23 |
| -COPY fs/shasumfile ${BUILD_BASE}/ |
24 |
| -RUN mkdir benchmarks && cd benchmarks && \ |
25 |
| - wget https://www.netlib.org/benchmark/whetstone.c https://www.netlib.org/benchmark/dhry-c && \ |
26 |
| - shasum -ca 256 ../shasumfile &&\ |
27 |
| - bash dhry-c && \ |
28 |
| - patch -p1 < ../dhrystone.patch && \ |
29 |
| - riscv64-linux-gnu-gcc-12 -O2 -o whetstone whetstone.c -lm && \ |
30 |
| - riscv64-linux-gnu-gcc-12 -O2 -o dhrystone dhry_1.c dhry_2.c -lm |
31 |
| - |
32 | 1 | # Final image
|
33 | 2 | FROM --platform=linux/riscv64 riscv64/ubuntu:22.04
|
34 |
| -ARG TOOLS_DEB=machine-emulator-tools-v0.15.0.deb |
| 3 | +ARG TOOLS_DEB=machine-emulator-tools-v0.16.2.deb |
35 | 4 | ADD ${TOOLS_DEB} /tmp/
|
36 | 5 | RUN apt-get update && \
|
37 |
| - apt-get install -y --no-install-recommends \ |
38 |
| - busybox-static=1:1.30.1-7ubuntu3 \ |
39 |
| - coreutils=8.32-4.1ubuntu1.2 \ |
40 |
| - bash=5.1-6ubuntu1.1 \ |
41 |
| - psmisc=23.4-2build3 \ |
42 |
| - bc=1.07.1-3build1 \ |
43 |
| - curl=7.81.0-1ubuntu1.17 \ |
44 |
| - device-tree-compiler=1.6.1-1 \ |
45 |
| - jq=1.6-2.1ubuntu3 \ |
46 |
| - lua5.4=5.4.4-1 \ |
47 |
| - lua-socket=3.0~rc1+git+ac3201d-6 \ |
48 |
| - xxd=2:8.2.3995-1ubuntu2.16 \ |
49 |
| - file=1:5.41-3ubuntu0.1 \ |
50 |
| - /tmp/${TOOLS_DEB} \ |
| 6 | + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ |
| 7 | + busybox-static=1:1.30.1-7ubuntu3 \ |
| 8 | + coreutils=8.32-4.1ubuntu1.2 \ |
| 9 | + bash=5.1-6ubuntu1.1 \ |
| 10 | + psmisc=23.4-2build3 \ |
| 11 | + bc=1.07.1-3build1 \ |
| 12 | + curl=7.81.0-1ubuntu1.18 \ |
| 13 | + device-tree-compiler=1.6.1-1 \ |
| 14 | + jq=1.6-2.1ubuntu3 \ |
| 15 | + lua5.4=5.4.4-1 \ |
| 16 | + lua-socket=3.0~rc1+git+ac3201d-6 \ |
| 17 | + xxd=2:8.2.3995-1ubuntu2.18 \ |
| 18 | + file=1:5.41-3ubuntu0.1 \ |
| 19 | + stress-ng=0.13.12-2ubuntu1 \ |
| 20 | + /tmp/${TOOLS_DEB} \ |
51 | 21 | && \
|
52 | 22 | rm -rf /var/lib/apt/lists/* /tmp/${TOOLS_DEB}
|
53 |
| -COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/whetstone /usr/bin/ |
54 |
| -COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/dhrystone /usr/bin/ |
0 commit comments