22# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33
44# # Build docker image that consists of gcc, cmake, wasi-sdk & zephyr sdk
5- FROM gcc:9.3 .0 AS BASE
5+ FROM gcc:12.2 .0 AS BASE
66
77# # set work directory
88WORKDIR /root/
99
1010COPY resource /root/
1111
12- # # - download cmake with wget and set up
12+ # - download cmake with wget and set up
1313# hadolint ignore=DL3008
14- RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.tar.gz \
15- && tar -zxf cmake-3.21.1-linux-x86_64.tar.gz \
16- && rm -f cmake-3.21.1-linux-x86_64.tar.gz \
17- && mv cmake-3.21.1-linux-x86_64 /opt/cmake \
18- && ln -s /opt/cmake/bin/cmake /bin/cmake \
19- && apt-get -y install make --no-install-recommends
20-
21- # # set compilation environment for wamrc
14+ RUN apt-get update \
15+ && apt-get -y install ccache ninja-build make cmake python3-pip --no-install-recommends
16+
17+ # set compilation environment for wamrc
2218# - wamr repo
2319# - cmake
2420# - wasi-sdk
2521# - wamr-sdk
2622
27- # # - download wasi-sdk with wget and set up to /opt/wasi-sdk
23+ # - download wasi-sdk with wget and set up to /opt/wasi-sdk
2824RUN wget --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz \
2925 && tar -zxf wasi-sdk-*-linux.tar.gz \
3026 && 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
3430RUN git clone -b main --depth=1 https://github.com/bytecodealliance/wasm-micro-runtime.git
3531
3632WORKDIR /root/wasm-micro-runtime/build-scripts
37- RUN apt-get update && apt-get install --no-install-recommends -y ccache ninja-build python3-pip
38- RUN pip3 install --user -r requirements.txt
33+ RUN pip3 install --no-cache-dir --user -r requirements.txt
3934
4035WORKDIR /root/wasm-micro-runtime/wamr-compiler
4136RUN ./build_llvm.sh \
@@ -53,26 +48,23 @@ RUN cmake .. \
5348 && rm -fr /root/wasm-micro-runtime
5449
5550# ## STAGE 2
56- FROM ubuntu:20 .04
51+ FROM ubuntu:22 .04
5752ENV HOME_DIR=/home/wasm-toolchain
5853
5954RUN mkdir -p /opt/wasi-sdk \
60- && mkdir -p /opt/cmake \
6155 && mkdir -p /opt/wamr-sdk/app \
6256 && mkdir -p /home/wasm-toolchain
6357
6458# COPY files from BASE image
65- COPY --from=BASE /opt/cmake/ /opt/cmake/
6659COPY --from=BASE /opt/wamr-sdk/app/ /opt/wamr-sdk/app/
6760COPY --from=BASE /opt/wasi-sdk /opt/wasi-sdk/
6861COPY --from=BASE /root/wamrc ${HOME_DIR}
6962COPY --from=BASE /root/build_wasm.sh ${HOME_DIR}
7063
71- RUN ln -s /opt/cmake/bin/cmake /usr/bin/cmake \
72- && ln -s ${HOME_DIR}/wamrc /usr/bin/wamrc
64+ RUN ln -s ${HOME_DIR}/wamrc /usr/bin/wamrc
7365
7466# hadolint ignore=DL3008
75- RUN apt-get update && apt-get install -y make --no-install-recommends \
67+ RUN apt-get update && apt-get install -y cmake make --no-install-recommends \
7668 && apt-get clean -y \
7769 && rm -rf /var/lib/apt/lists/*
7870
0 commit comments