Dockerfile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. ARG VARIANT=focal
  4. FROM ubuntu:${VARIANT}
  5. ARG DEBIAN_FRONTEND=noninteractive
  6. ENV TZ=Asian/Shanghai
  7. RUN apt update \
  8. && apt install -y apt-transport-https apt-utils build-essential \
  9. ca-certificates curl g++-multilib git gnupg \
  10. libgcc-9-dev lib32gcc-9-dev lsb-release \
  11. ninja-build ocaml ocamlbuild python2.7 \
  12. software-properties-common tree tzdata \
  13. unzip valgrind vim wget zip
  14. #
  15. # CMAKE (https://apt.kitware.com/)
  16. RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null \
  17. && echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
  18. && apt update \
  19. && rm /usr/share/keyrings/kitware-archive-keyring.gpg \
  20. && apt install -y kitware-archive-keyring \
  21. && apt install -y cmake
  22. #
  23. # install emsdk (may not necessary ?)
  24. RUN cd /opt \
  25. && git clone https://github.com/emscripten-core/emsdk.git
  26. RUN cd /opt/emsdk \
  27. && git pull \
  28. && ./emsdk install 2.0.26 \
  29. && ./emsdk activate 2.0.26 \
  30. && echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
  31. #
  32. #install wabt
  33. ARG WABT_VER=1.0.24
  34. RUN wget -c https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt
  35. RUN tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
  36. && ln -fs /opt/wabt-${WABT_VER} /opt/wabt
  37. RUN rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
  38. #
  39. # install binaryen
  40. ARG BINARYEN_VER=version_101
  41. RUN wget -c https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN_VER}/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz -P /opt
  42. RUN tar xf /opt/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz -C /opt \
  43. && ln -fs /opt/binaryen-${BINARYEN_VER} /opt/binaryen
  44. RUN rm /opt/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz
  45. #
  46. # install bazelisk
  47. ARG BAZELISK_VER=1.10.1
  48. RUN mkdir /opt/bazelisk
  49. RUN wget -c https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk
  50. RUN chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
  51. && ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
  52. # set path
  53. RUN echo "PATH=/opt/clang_llvm/bin:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:${PATH}" >> /root/.bashrc
  54. #
  55. # PS
  56. RUN echo "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc
  57. # Clean up
  58. RUN apt-get autoremove -y \
  59. && apt-get clean -y \
  60. && rm -rf /var/lib/apt/lists/* \
  61. && rm -rf /tmp/*
  62. VOLUME workspace
  63. WORKDIR workspace