diff --git a/resources/docker_files/README.md b/resources/docker_files/README.md index 63bae0982..af2e6b5a1 100644 --- a/resources/docker_files/README.md +++ b/resources/docker_files/README.md @@ -17,7 +17,7 @@ See the [Quick Start section of the top-level README](../../README.md#quick-star A docker image can be built with following command: ```sh -cd mbedtls-test/dev_envs/docker_files +cd mbedtls-test/resources/docker_files sudo docker build --network=host -t ubuntu-18.04 -f ubuntu-18.04/Dockerfile . ``` This creates an image from the specified file. The built image is maintained by docker in its own workspace on the host. Don't worry where the built image is gone! From this point the built image is referred by its tag name. For example `ubuntu-18.04`. See [Listing images](#listing-images) below. diff --git a/resources/docker_files/ubuntu-16.04/Dockerfile b/resources/docker_files/ubuntu-16.04/Dockerfile index 9ff83d835..29fa35178 100644 --- a/resources/docker_files/ubuntu-16.04/Dockerfile +++ b/resources/docker_files/ubuntu-16.04/Dockerfile @@ -48,10 +48,14 @@ RUN apt-get update -q && apt-get install -yq \ autotools-dev \ # to build Mbed TLS: gcc, binutils, make, etc. build-essential \ + # to build Mbed TLS using earliest gcc version + gcc-4.7 \ # to generate malformed files bsdmainutils \ # to build Mbed TLS clang \ + # to build Mbed TLS using earliest clang version + clang-3.5 \ # to build Mbed TLS cmake \ # to build Mbed TLS's documentation @@ -112,7 +116,10 @@ RUN apt-get update -q && apt-get install -yq \ libstdc++6:armhf \ ;; \ esac && \ - rm -rf /var/lib/apt/lists/ + rm -rf /var/lib/apt/lists/ && \ + # create symbolic links for earliest gcc and clang versions + ln -s /usr/bin/gcc-4.7 /usr/local/bin/gcc-earliest && \ + ln -s /usr/bin/clang-3.5 /usr/local/bin/clang-earliest # Install all the parts of gcc-multilib, which is necessary for 32-bit builds. # gcc-multilib conflicts with cross-compiler packages that we'll install later, diff --git a/resources/docker_files/ubuntu-22.04/Dockerfile b/resources/docker_files/ubuntu-22.04/Dockerfile index 3ed3f47b9..c1f7b7c44 100644 --- a/resources/docker_files/ubuntu-22.04/Dockerfile +++ b/resources/docker_files/ubuntu-22.04/Dockerfile @@ -66,6 +66,8 @@ RUN apt-get update -q && apt-get install -yq \ faketime \ # to cross-build Mbed TLS gcc-mingw-w64-i686 \ + # to build Mbed TLS using latest gcc version available from Ubuntu + gcc-12 \ # to check out Mbed TLS and others git \ # to build Mbed TLS's documentation @@ -90,6 +92,8 @@ RUN apt-get update -q && apt-get install -yq \ pkg-config \ # to install Python packages python3-pip \ + # provides some useful scripts for adding and removing repositories + software-properties-common \ # for Mbed TLS tests valgrind \ # to download things installed from other places @@ -118,7 +122,18 @@ RUN apt-get update -q && apt-get install -yq \ libstdc++6:armhf \ ;; \ esac && \ - rm -rf /var/lib/apt/lists/ + rm -rf /var/lib/apt/lists/ + +# For installing clang-16, we add the llvm package source and add corresponding key +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 15CF4D18AF4F7421 && \ + # add an apt package source from https://apt.llvm.org/ + add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main' -y && \ + apt-get install -yq \ + # to build Mbed TLS using latest clang version at the time of writing + clang-16 && \ + # create symbolic links for latest gcc and clang versions + ln -s /usr/bin/clang-16 /usr/local/bin/clang-latest && \ + ln -s /usr/bin/gcc-12 /usr/local/bin/gcc-latest # Install all the parts of gcc-multilib, which is necessary for 32-bit builds. # gcc-multilib conflicts with cross-compiler packages that we'll install later,