|
@@ -2,29 +2,25 @@
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
## Build docker image that consists of gcc, cmake, wasi-sdk & zephyr sdk
|
|
## Build docker image that consists of gcc, cmake, wasi-sdk & zephyr sdk
|
|
|
-FROM gcc:9.3.0 AS BASE
|
|
|
|
|
|
|
+FROM gcc:12.2.0 AS BASE
|
|
|
|
|
|
|
|
## set work directory
|
|
## set work directory
|
|
|
WORKDIR /root/
|
|
WORKDIR /root/
|
|
|
|
|
|
|
|
COPY resource /root/
|
|
COPY resource /root/
|
|
|
|
|
|
|
|
-## - download cmake with wget and set up
|
|
|
|
|
|
|
+# - download cmake with wget and set up
|
|
|
# hadolint ignore=DL3008
|
|
# hadolint ignore=DL3008
|
|
|
-RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.tar.gz \
|
|
|
|
|
- && tar -zxf cmake-3.21.1-linux-x86_64.tar.gz \
|
|
|
|
|
- && rm -f cmake-3.21.1-linux-x86_64.tar.gz \
|
|
|
|
|
- && mv cmake-3.21.1-linux-x86_64 /opt/cmake \
|
|
|
|
|
- && ln -s /opt/cmake/bin/cmake /bin/cmake \
|
|
|
|
|
- && apt-get -y install make --no-install-recommends
|
|
|
|
|
-
|
|
|
|
|
-## set compilation environment for wamrc
|
|
|
|
|
|
|
+RUN apt-get update \
|
|
|
|
|
+ && apt-get -y install ccache ninja-build make cmake python3-pip --no-install-recommends
|
|
|
|
|
+
|
|
|
|
|
+# set compilation environment for wamrc
|
|
|
# - wamr repo
|
|
# - wamr repo
|
|
|
# - cmake
|
|
# - cmake
|
|
|
# - wasi-sdk
|
|
# - wasi-sdk
|
|
|
# - wamr-sdk
|
|
# - wamr-sdk
|
|
|
|
|
|
|
|
-## - download wasi-sdk with wget and set up to /opt/wasi-sdk
|
|
|
|
|
|
|
+# - download wasi-sdk with wget and set up to /opt/wasi-sdk
|
|
|
RUN wget --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz \
|
|
RUN wget --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz \
|
|
|
&& tar -zxf wasi-sdk-*-linux.tar.gz \
|
|
&& tar -zxf wasi-sdk-*-linux.tar.gz \
|
|
|
&& mv wasi-sdk-19.0 /opt/wasi-sdk/ \
|
|
&& mv wasi-sdk-19.0 /opt/wasi-sdk/ \
|
|
@@ -34,8 +30,7 @@ RUN wget --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/do
|
|
|
RUN git clone -b main --depth=1 https://github.com/bytecodealliance/wasm-micro-runtime.git
|
|
RUN git clone -b main --depth=1 https://github.com/bytecodealliance/wasm-micro-runtime.git
|
|
|
|
|
|
|
|
WORKDIR /root/wasm-micro-runtime/build-scripts
|
|
WORKDIR /root/wasm-micro-runtime/build-scripts
|
|
|
-RUN apt-get update && apt-get install --no-install-recommends -y ccache ninja-build python3-pip
|
|
|
|
|
-RUN pip3 install --user -r requirements.txt
|
|
|
|
|
|
|
+RUN pip3 install --no-cache-dir --user -r requirements.txt
|
|
|
|
|
|
|
|
WORKDIR /root/wasm-micro-runtime/wamr-compiler
|
|
WORKDIR /root/wasm-micro-runtime/wamr-compiler
|
|
|
RUN ./build_llvm.sh \
|
|
RUN ./build_llvm.sh \
|
|
@@ -53,26 +48,23 @@ RUN cmake .. \
|
|
|
&& rm -fr /root/wasm-micro-runtime
|
|
&& rm -fr /root/wasm-micro-runtime
|
|
|
|
|
|
|
|
# ## STAGE 2
|
|
# ## STAGE 2
|
|
|
-FROM ubuntu:20.04
|
|
|
|
|
|
|
+FROM ubuntu:22.04
|
|
|
ENV HOME_DIR=/home/wasm-toolchain
|
|
ENV HOME_DIR=/home/wasm-toolchain
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/wasi-sdk \
|
|
RUN mkdir -p /opt/wasi-sdk \
|
|
|
- && mkdir -p /opt/cmake \
|
|
|
|
|
&& mkdir -p /opt/wamr-sdk/app \
|
|
&& mkdir -p /opt/wamr-sdk/app \
|
|
|
&& mkdir -p /home/wasm-toolchain
|
|
&& mkdir -p /home/wasm-toolchain
|
|
|
|
|
|
|
|
# COPY files from BASE image
|
|
# COPY files from BASE image
|
|
|
-COPY --from=BASE /opt/cmake/ /opt/cmake/
|
|
|
|
|
COPY --from=BASE /opt/wamr-sdk/app/ /opt/wamr-sdk/app/
|
|
COPY --from=BASE /opt/wamr-sdk/app/ /opt/wamr-sdk/app/
|
|
|
COPY --from=BASE /opt/wasi-sdk /opt/wasi-sdk/
|
|
COPY --from=BASE /opt/wasi-sdk /opt/wasi-sdk/
|
|
|
COPY --from=BASE /root/wamrc ${HOME_DIR}
|
|
COPY --from=BASE /root/wamrc ${HOME_DIR}
|
|
|
COPY --from=BASE /root/build_wasm.sh ${HOME_DIR}
|
|
COPY --from=BASE /root/build_wasm.sh ${HOME_DIR}
|
|
|
|
|
|
|
|
-RUN ln -s /opt/cmake/bin/cmake /usr/bin/cmake \
|
|
|
|
|
- && ln -s ${HOME_DIR}/wamrc /usr/bin/wamrc
|
|
|
|
|
|
|
+RUN ln -s ${HOME_DIR}/wamrc /usr/bin/wamrc
|
|
|
|
|
|
|
|
# hadolint ignore=DL3008
|
|
# hadolint ignore=DL3008
|
|
|
-RUN apt-get update && apt-get install -y make --no-install-recommends \
|
|
|
|
|
|
|
+RUN apt-get update && apt-get install -y cmake make --no-install-recommends \
|
|
|
&& apt-get clean -y \
|
|
&& apt-get clean -y \
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|