2022-08-04 09:00:38 +00:00
|
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp/.devcontainer/base.Dockerfile
|
|
|
|
# [Choice] Debian / Ubuntu version (use Debian 11/9, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
|
|
|
|
ARG VARIANT=ubuntu-20.04
|
|
|
|
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ENV TZ=Asian/Shanghai
|
|
|
|
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y apt-transport-https apt-utils build-essential \
|
2022-08-04 09:00:38 +00:00
|
|
|
ca-certificates curl g++-multilib git gnupg \
|
|
|
|
libgcc-9-dev lib32gcc-9-dev lsb-release \
|
|
|
|
ninja-build ocaml ocamlbuild python2.7 \
|
|
|
|
software-properties-common tree tzdata \
|
2022-09-22 05:06:11 +00:00
|
|
|
unzip valgrind vim wget zip --no-install-recommends \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# CMAKE (https://apt.kitware.com/)
|
2022-09-22 05:06:11 +00:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN wget --progress=dot:giga -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 \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& 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 \
|
2022-09-22 05:06:11 +00:00
|
|
|
&& apt-get update \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
|
2022-09-22 05:06:11 +00:00
|
|
|
&& apt-get install -y kitware-archive-keyring --no-install-recommends \
|
|
|
|
&& apt-get install -y cmake --no-install-recommends \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# install emsdk
|
2022-09-22 05:06:11 +00:00
|
|
|
WORKDIR /opt
|
|
|
|
RUN git clone https://github.com/emscripten-core/emsdk.git
|
|
|
|
|
|
|
|
WORKDIR /opt/emsdk
|
|
|
|
RUN git pull \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& ./emsdk install 2.0.26 \
|
|
|
|
&& ./emsdk activate 2.0.26 \
|
|
|
|
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
|
|
|
|
|
|
|
|
#
|
|
|
|
# install wasi-sdk
|
|
|
|
ARG WASI_SDK_VER=16
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER}/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -P /opt \
|
|
|
|
&& tar xf /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -C /opt \
|
|
|
|
&& ln -fs /opt/wasi-sdk-${WASI_SDK_VER}.0 /opt/wasi-sdk \
|
|
|
|
&& rm /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
#install wabt
|
|
|
|
ARG WABT_VER=1.0.29
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt \
|
|
|
|
&& tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
|
|
|
|
&& ln -fs /opt/wabt-${WABT_VER} /opt/wabt \
|
|
|
|
&& rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# install bazelisk
|
|
|
|
ARG BAZELISK_VER=1.12.0
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN mkdir /opt/bazelisk \
|
|
|
|
&& wget -c --progress=dot:giga https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk \
|
|
|
|
&& chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
|
|
|
|
|
|
|
|
#
|
|
|
|
# install clang+llvm
|
2022-09-22 05:06:11 +00:00
|
|
|
WORKDIR /etc/apt/apt.conf.d
|
|
|
|
RUN touch 99verfiy-peer.conf \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& echo "Acquire { https::Verify-Peer false }" > 99verfiy-peer.conf
|
2022-09-22 05:06:11 +00:00
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
RUN wget --progress=dot:giga https://apt.llvm.org/llvm.sh \
|
|
|
|
&& chmod a+x ./llvm.sh \
|
|
|
|
&& /tmp/llvm.sh 12 all \
|
|
|
|
&& ln -sf /usr/bin/clang-format-12 /usr/bin/clang-format \
|
|
|
|
&& rm -rf /tmp/*
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# [Optional]
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install pip
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --reinstall python3-venv python3-pip --no-install-recommends \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-08-04 09:00:38 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install required python packages
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN python3 -m pip install --no-cache-dir --upgrade pip \
|
|
|
|
&& pip3 install --no-cache-dir --user black nose pycparser pylint
|
2022-08-04 09:00:38 +00:00
|
|
|
|
2022-09-22 05:06:11 +00:00
|
|
|
# set path, PS and clean up
|
2022-08-04 09:00:38 +00:00
|
|
|
ENV PATH "/opt/bazelisk:/opt/clang-llvm/bin:${PATH}"
|
2022-09-22 05:06:11 +00:00
|
|
|
RUN echo "export PATH=/opt/bazelisk:/opt/clang-llvm/bin:${PATH}" >> /root/.bashrc \
|
|
|
|
&& printf "%s\n" "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc \
|
|
|
|
&& apt-get autoremove -y \
|
2022-08-04 09:00:38 +00:00
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& rm -rf /tmp/*
|
2022-09-22 05:06:11 +00:00
|
|
|
|
|
|
|
# set workdir when container run
|
|
|
|
VOLUME /workspace
|
|
|
|
WORKDIR /workspace
|