1- FROM ubuntu:latest as build
1+ FROM ubuntu:22.04 as build
22
33ENV TZ=Europe/Rome
44RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
55 apt-get update && \
66 apt-get install -y \
77 build-essential \
88 # Intall clang compiler used by macos
9- clang \
9+ clang-13 \
1010 cmake \
1111 curl \
1212 dh-autoreconf \
@@ -24,9 +24,12 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
2424 tar \
2525 unzip \
2626 llvm \
27- && rm -rf /var/lib/apt/lists/*
27+ && rm -rf /var/lib/apt/lists/* \
28+ && ln -s /usr/bin/clang-13 /usr/bin/clang \
29+ && ln -s /usr/bin/clang++-13 /usr/bin/clang++
30+
2831# Install toolchains in /opt
29- RUN curl downloads.arduino.cc/tools/internal/toolchains.tar.gz | tar -xz "opt"
32+ RUN curl -L downloads.arduino.cc/tools/internal/toolchains.tar.gz | tar -xz "opt"
3033 # install proper arm toolchains (already present in the toolchains.tar.gz archive)
3134 # curl -L 'https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz' | tar -xJC /opt && \
3235 # curl -L 'https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz' | tar -xJC /opt
@@ -35,7 +38,8 @@ RUN cd /opt/osxcross && \
3538 git pull && \
3639 # use a specific version of osxcross (it does not have tags), this commit has the automatic install of compiler_rt libraries
3740 git checkout b875d7c1360c8ff2077463d7a5a12e1cff1cc683 && \
38- UNATTENDED=1 SDK_VERSION=10.15 ./build.sh && \
41+ UNATTENDED=1 SDK_VERSION=10.15 ./build.sh
42+ RUN cd /opt/osxcross && \
3943 ENABLE_COMPILER_RT_INSTALL=1 SDK_VERSION=10.15 ./build_compiler_rt.sh
4044# Set toolchains paths
4145# arm-linux-gnueabihf-gcc -> linux_arm
@@ -50,25 +54,25 @@ WORKDIR /workdir
5054# Handle libusb and libudev compilation and merging
5155COPY deps/ /opt/lib/
5256# compiler name is arm-linux-gnueabihf-gcc '-gcc' is added by ./configure
53- RUN CROSS_COMPILE=x86_64-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
54- CROSS_COMPILE=arm-linux-gnueabihf /opt/lib/build_libs.sh && \
55- CROSS_COMPILE=aarch64-linux-gnu /opt/lib/build_libs.sh && \
56- CROSS_COMPILE=i686-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
57- CROSS_COMPILE=i686-w64-mingw32 /opt/lib/build_libs.sh && \
58- # CROSS_COMPILER is used to override the compiler
59- CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 AR=/opt/osxcross/target/bin/x86_64-apple-darwin13-ar RANLIB=/opt/osxcross/target/bin/x86_64-apple-darwin13-ranlib /opt/lib/build_libs.sh
57+ RUN CROSS_COMPILE=x86_64-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh
58+ RUN CROSS_COMPILE=arm-linux-gnueabihf /opt/lib/build_libs.sh
59+ RUN CROSS_COMPILE=aarch64-linux-gnu /opt/lib/build_libs.sh
60+ RUN CROSS_COMPILE=i686-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh
61+ RUN CROSS_COMPILE=i686-w64-mingw32 /opt/lib/build_libs.sh
62+ # CROSS_COMPILER is used to override the compiler
63+ RUN CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 AR=/opt/osxcross/target/bin/x86_64-apple-darwin13-ar RANLIB=/opt/osxcross/target/bin/x86_64-apple-darwin13-ranlib /opt/lib/build_libs.sh
6064
61- FROM ubuntu:latest
65+ FROM ubuntu:22.04
6266# Copy all the installed toolchains and compiled libs
6367COPY --from=build /opt /opt
64- COPY --from=build /usr/lib/llvm-10 /lib/clang/10 .0.0 /usr/lib/llvm-10 /lib/clang/10 .0.0
68+ COPY --from=build /usr/lib/llvm-13 /lib/clang/13 .0.1 /usr/lib/llvm-13 /lib/clang/13 .0.1
6569ENV TZ=Europe/Rome
6670RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
6771 apt-get update && \
6872 apt-get install -y \
6973 build-essential \
7074 # Intall clang compiler used by macos
71- clang \
75+ clang-13 \
7276 cmake \
7377 dh-autoreconf \
7478 git \
@@ -79,7 +83,9 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
7983 tar \
8084 bison \
8185 flex \
82- && rm -rf /var/lib/apt/lists/*
86+ && rm -rf /var/lib/apt/lists/* \
87+ && ln -s /usr/bin/clang-13 /usr/bin/clang \
88+ && ln -s /usr/bin/clang++-13 /usr/bin/clang++
8389# Set toolchains paths
8490# arm-linux-gnueabihf-gcc -> linux_arm
8591# aarch64-linux-gnu-gcc -> linux_arm64
0 commit comments