dockerfile: update building wamr dependencies

This commit is contained in:
2026-01-25 19:45:46 +01:00
parent d94c99b36a
commit 32a9ab4cc1

View File

@ -3,6 +3,7 @@ FROM ubuntu:noble AS wamr-builder
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=Europe/Berline apt-get install -y --no-install-recommends \ && DEBIAN_FRONTEND=noninteractive TZ=Europe/Berline apt-get install -y --no-install-recommends \
build-essential \ build-essential \
busybox \
git \ git \
cmake \ cmake \
ca-certificates \ ca-certificates \
@ -23,11 +24,12 @@ RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime \
&& git checkout WAMR-2.4.4 && git checkout WAMR-2.4.4
WORKDIR /wasm-micro-runtime WORKDIR /wasm-micro-runtime
# Build WAMR vmcore # Build WAMR iwasm (standalone interpreter)
RUN mkdir build && cd build \ RUN cd product-mini/platforms/linux \
&& mkdir build_iwasm && cd build_iwasm \
&& cmake \ && cmake \
-DWAMR_BUILD_AOT=1 \ -DWAMR_BUILD_AOT=0 \
-DWAMR_BUILD_WAMR_COMPILER=1 \ -DWAMR_BUILD_WAMR_COMPILER=0 \
-DWAMR_BUILD_INTERP=1 \ -DWAMR_BUILD_INTERP=1 \
-DWAMR_BUILD_FAST_INTERP=0 \ -DWAMR_BUILD_FAST_INTERP=0 \
-DWAMR_BUILD_JIT=0 \ -DWAMR_BUILD_JIT=0 \
@ -37,17 +39,50 @@ RUN mkdir build && cd build \
.. \ .. \
&& make -j$(nproc) && make -j$(nproc)
# Build WAMR wamrc # Build WAMR libiwasm (interpreter runtime)
RUN cd wamr-compiler \ RUN mkdir build_libiwasm && cd build_libiwasm \
&& ./build_llvm.sh \ && cmake \
&& mkdir build && cd build \ -DWAMR_BUILD_AOT=1 \
&& cmake .. \ -DWAMR_BUILD_WAMR_COMPILER=0 \
-DWAMR_BUILD_INTERP=1 \
-DWAMR_BUILD_FAST_INTERP=0 \
-DWAMR_BUILD_JIT=0 \
-DWAMR_BUILD_FAST_JIT=0 \
-DWAMR_BUILD_LIBC_BUILTIN=1 \
-DWAMR_BUILD_LIBC_WASI=1 \
.. \
&& make -j$(nproc) && make -j$(nproc)
# Build WAMR iwasm # Build WAMR wamrc (standalone compiler)
RUN cd product-mini/platforms/linux \ RUN cd wamr-compiler \
&& mkdir build && cd build \ && ./build_llvm.sh \
&& cmake .. \ && mkdir build_wamrc && cd build_wamrc \
&& cmake \
-DWAMR_BUILD_AOT=0 \
-DWAMR_BUILD_WAMR_COMPILER=1 \
-DWAMR_BUILD_INTERP=0 \
-DWAMR_BUILD_FAST_INTERP=0 \
-DWAMR_BUILD_JIT=0 \
-DWAMR_BUILD_FAST_JIT=0 \
-DWAMR_BUILD_LIBC_BUILTIN=1 \
-DWAMR_BUILD_LIBC_WASI=1 \
.. \
&& make -j$(nproc)
# Build WAMR libvmlib (compiler runtime)
RUN cd wamr-compiler \
&& ./build_llvm.sh \
&& mkdir build_libvmlib && cd build_libvmlib \
&& cmake \
-DWAMR_BUILD_AOT=1 \
-DWAMR_BUILD_WAMR_COMPILER=0 \
-DWAMR_BUILD_INTERP=1 \
-DWAMR_BUILD_FAST_INTERP=0 \
-DWAMR_BUILD_JIT=0 \
-DWAMR_BUILD_FAST_JIT=0 \
-DWAMR_BUILD_LIBC_BUILTIN=1 \
-DWAMR_BUILD_LIBC_WASI=1 \
.. \
&& make -j$(nproc) && make -j$(nproc)
# ============================================================================= # =============================================================================
@ -62,16 +97,14 @@ RUN apt-get update \
neovim \ neovim \
ranger \ ranger \
wabt \ wabt \
busybox \
&& apt-get clean && apt-get clean
COPY --from=wamr-builder /wasm-micro-runtime /opt/wamr COPY --from=wamr-builder /wasm-micro-runtime /opt/wamr
# COPY --from=wamr-builder /wasm-micro-runtime/build /opt/wamr-vmcore RUN ln -sf /opt/wamr/product-mini/platforms/linux/build_iwasm /opt/wamr-iwasm \
# COPY --from=wamr-builder /wasm-micro-runtime/wamr-compiler/build /opt/wamr-wamrc && ln -sf /opt/wamr/build_libiwasm /opt/wamr-libiwasm \
# COPY --from=wamr-builder /wasm-micro-runtime/product-mini/platforms/linux/build /opt/wamr-iwasm && ln -sf /opt/wamr/wamr-compiler/build_wamrc /opt/wamr-wamrc \
&& ln -sf /opt/wamr/wamr-compiler/build_libvmlib /opt/wamr-libvmlib
RUN ln -sf /opt/wamr/build /opt/wamr-vmcore \
&& ln -sf /opt/wamr/wamr-compiler/build /opt/wamr-wamrc \
&& ln -sf /opt/wamr/product-mini/platforms/linux/build /opt/wamr-iwasm
COPY ./examples /home/ubuntu/examples COPY ./examples /home/ubuntu/examples
WORKDIR /home/ubuntu/examples WORKDIR /home/ubuntu/examples