Dockerfile 2.7 KB

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