mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-11 09:25:20 +00:00
Use clang+llvm released binaries instead of "apt install" in Dockerfile (#952)
This commit is contained in:
parent
3fddd3fde4
commit
36b8f8fca2
|
@ -1,6 +1,8 @@
|
||||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||||
|
|
||||||
|
# tie the ${VARIANT} and a llvm binary release together
|
||||||
|
# please find a matched version on https://github.com/llvm/llvm-project/releases
|
||||||
ARG VARIANT=focal
|
ARG VARIANT=focal
|
||||||
FROM ubuntu:${VARIANT}
|
FROM ubuntu:${VARIANT}
|
||||||
|
|
||||||
|
@ -35,9 +37,14 @@ RUN cd /opt/emsdk \
|
||||||
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
|
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
|
||||||
|
|
||||||
#
|
#
|
||||||
# install clang and llvm
|
# install clang and llvm release
|
||||||
RUN cd /tmp && wget https://apt.llvm.org/llvm.sh && chmod a+x llvm.sh
|
ARG CLANG_VER=13.0.0
|
||||||
RUN cd /tmp && ./llvm.sh 12
|
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VER}/clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04.tar.xz -P /opt
|
||||||
|
RUN cd /opt \
|
||||||
|
&& tar xf clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04.tar.xz \
|
||||||
|
&& ln -sf clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04 clang-llvm
|
||||||
|
RUN rm /opt/clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04.tar.xz
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# install wasi-sdk
|
# install wasi-sdk
|
||||||
|
@ -68,8 +75,8 @@ RUN chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
|
||||||
RUN apt update && apt install -y clang-format
|
RUN apt update && apt install -y clang-format
|
||||||
|
|
||||||
# set path
|
# set path
|
||||||
ENV PATH "$PATH:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk"
|
ENV PATH "$PATH:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:/opt/clang-llvm/bin"
|
||||||
RUN echo "export PATH=/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:${PATH}" >> /root/.bashrc
|
RUN echo "export PATH=/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:/opt/clang-llvm/bin:${PATH}" >> /root/.bashrc
|
||||||
|
|
||||||
#
|
#
|
||||||
# PS
|
# PS
|
||||||
|
|
|
@ -8,7 +8,6 @@ readonly ROOT=$(realpath "${CURRENT_PATH}/..")
|
||||||
readonly VARIANT=$(lsb_release -c | awk '{print $2}')
|
readonly VARIANT=$(lsb_release -c | awk '{print $2}')
|
||||||
|
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg VARIANT=${VARIANT} \
|
|
||||||
--memory=4G --cpu-quota=50000 \
|
--memory=4G --cpu-quota=50000 \
|
||||||
-t wamr_dev_${VARIANT}:0.1 -f "${CURRENT_PATH}"/Dockerfile "${CURRENT_PATH}" \
|
-t wamr_dev_${VARIANT}:0.1 -f "${CURRENT_PATH}"/Dockerfile "${CURRENT_PATH}" \
|
||||||
&& docker run --rm -it \
|
&& docker run --rm -it \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user