Skip to content

Commit 36b8f8f

Browse files
authored
Use clang+llvm released binaries instead of "apt install" in Dockerfile (#952)
1 parent 3fddd3f commit 36b8f8f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ci/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4+
# tie the ${VARIANT} and a llvm binary release together
5+
# please find a matched version on https://github.com/llvm/llvm-project/releases
46
ARG VARIANT=focal
57
FROM ubuntu:${VARIANT}
68

@@ -35,9 +37,14 @@ RUN cd /opt/emsdk \
3537
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
3638

3739
#
38-
# install clang and llvm
39-
RUN cd /tmp && wget https://apt.llvm.org/llvm.sh && chmod a+x llvm.sh
40-
RUN cd /tmp && ./llvm.sh 12
40+
# install clang and llvm release
41+
ARG CLANG_VER=13.0.0
42+
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
43+
RUN cd /opt \
44+
&& tar xf clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04.tar.xz \
45+
&& ln -sf clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04 clang-llvm
46+
RUN rm /opt/clang+llvm-${CLANG_VER}-x86_64-linux-gnu-ubuntu-20.04.tar.xz
47+
4148

4249
#
4350
# install wasi-sdk
@@ -68,8 +75,8 @@ RUN chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
6875
RUN apt update && apt install -y clang-format
6976

7077
# set path
71-
ENV PATH "$PATH:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk"
72-
RUN echo "export PATH=/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:${PATH}" >> /root/.bashrc
78+
ENV PATH "$PATH:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:/opt/clang-llvm/bin"
79+
RUN echo "export PATH=/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:/opt/clang-llvm/bin:${PATH}" >> /root/.bashrc
7380

7481
#
7582
# PS

ci/build_wamr.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ readonly ROOT=$(realpath "${CURRENT_PATH}/..")
88
readonly VARIANT=$(lsb_release -c | awk '{print $2}')
99

1010
docker build \
11-
--build-arg VARIANT=${VARIANT} \
1211
--memory=4G --cpu-quota=50000 \
1312
-t wamr_dev_${VARIANT}:0.1 -f "${CURRENT_PATH}"/Dockerfile "${CURRENT_PATH}" \
1413
&& docker run --rm -it \

0 commit comments

Comments
 (0)