Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. FROM gcc:9.3.0 AS BASE
  4. ## set work directory
  5. WORKDIR /root/
  6. COPY resource /root/
  7. ## - download cmake with wget and set up
  8. # hadolint ignore=DL3008
  9. RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.tar.gz \
  10. && tar -zxvf cmake-3.21.1-linux-x86_64.tar.gz \
  11. && rm -f cmake-3.21.1-linux-x86_64.tar.gz \
  12. && mv cmake-3.21.1-linux-x86_64 /opt/cmake \
  13. && ln -s /opt/cmake/bin/cmake /bin/cmake \
  14. && apt-get -y install make --no-install-recommends
  15. ## -clone wamr-repo and build iwasm
  16. RUN git clone -b main --depth=1 https://github.com/bytecodealliance/wasm-micro-runtime.git \
  17. && mkdir -p /root/wasm-micro-runtime/product-mini/platforms/linux/build
  18. WORKDIR /root/wasm-micro-runtime/product-mini/platforms/linux/build
  19. RUN cmake .. -DWAMR_BUILD_DEBUG_INTERP=1 && make \
  20. && cp /root/wasm-micro-runtime/product-mini/platforms/linux/build/iwasm /root/iwasm \
  21. && rm -fr /root/wasm-micro-runtime
  22. FROM ubuntu:20.04
  23. # COPY files from BASE image
  24. COPY --from=BASE /root/iwasm /root
  25. COPY --from=BASE /root/debug.sh /root
  26. COPY --from=BASE /root/run.sh /root
  27. WORKDIR /root/