dockcross/linux-x64-clang/Dockerfile.in

44 lines
2.0 KiB
Docker
Raw Permalink Normal View History

FROM dockcross/base:latest
LABEL maintainer="Matt McCormick matt.mccormick@kitware.com"
ARG CLANG_VERSION=13
ENV CLANG_VERSION=${CLANG_VERSION}
RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main" >> /etc/apt/sources.list \
&& echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${CLANG_VERSION} main" >> /etc/apt/sources.list \
&& echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main" >> /etc/apt/sources.list \
&& echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${CLANG_VERSION} main" >> /etc/apt/sources.list \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& apt-get update \
&& apt-get purge --autoremove -y gcc g++ software-properties-common \
&& apt-get -y install clang-${CLANG_VERSION} libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev clang-format-${CLANG_VERSION} clang-tidy-${CLANG_VERSION} lldb-${CLANG_VERSION} \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${CLANG_VERSION} 90 \
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${CLANG_VERSION} 90 \
&& update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-${CLANG_VERSION} 90 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 90 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 90 \
&& cc --version \
&& c++ --version \
&& cpp --version
ENV CROSS_TRIPLE x86_64-linux-gnu
ENV CROSS_ROOT /usr/bin
ENV CC=/usr/bin/clang \
CPP=/usr/bin/cpp \
CXX=/usr/bin/clang++ \
LD=/usr/bin/lld \
FC=/usr/bin/flang
# AS=/usr/bin/${CROSS_TRIPLE}-as
# AR=/usr/bin/${CROSS_TRIPLE}-ar
COPY ${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop
COPY Toolchain.cmake /usr/lib/${CROSS_TRIPLE}/
ENV CMAKE_TOOLCHAIN_FILE /usr/lib/${CROSS_TRIPLE}/Toolchain.cmake
#include "common.label-and-env"