Dockerfile.cpu 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. FROM ubuntu:20.04 AS base
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. # hadolint ignore=DL3008,DL3009
  6. RUN apt-get update \
  7. && apt-get install -y --no-install-recommends\
  8. ca-certificates cmake build-essential git wget
  9. WORKDIR /usr/local/share/ca-certificates/cacert.org
  10. RUN wget -qP /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt \
  11. && update-ca-certificates
  12. # need a newer cmake
  13. RUN apt-get purge -y cmake
  14. ARG CMAKE_VER=3.27.0
  15. RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh \
  16. -q -O /tmp/cmake-install.sh \
  17. && chmod u+x /tmp/cmake-install.sh \
  18. && mkdir /opt/cmake-${CMAKE_VER} \
  19. && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-${CMAKE_VER} \
  20. && rm /tmp/cmake-install.sh \
  21. && ln -s /opt/cmake-${CMAKE_VER}/bin/* /usr/local/bin
  22. WORKDIR /home/wamr
  23. COPY . .
  24. RUN git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
  25. WORKDIR /home/wamr/product-mini/platforms/linux
  26. RUN rm -rf build \
  27. && cmake -S . -B build\
  28. -DWAMR_BUILD_WASI_NN=1 -DWAMR_BUILD_WASI_NN_TFLITE=1\
  29. && cmake --build build -j "$(grep -c ^processor /proc/cpuinfo)"
  30. FROM ubuntu:22.04
  31. COPY --from=base /home/wamr/product-mini/platforms/linux/build/iwasm /usr/bin
  32. COPY --from=base /home/wamr/product-mini/platforms/linux/build/lib*.so /usr/lib
  33. ENV LD_LIBRARY_PATH=/usr/lib
  34. ENTRYPOINT [ "iwasm" ]