Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/docker_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 8 additions & 1 deletion resources/docker_files/ubuntu-16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
17 changes: 16 additions & 1 deletion resources/docker_files/ubuntu-22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ RUN apt-get update -q && apt-get install -yq \
zlib1g \
# to build Mbed TLS with MBEDTLS_ZILIB_SUPPORT (removed in 3.0)
zlib1g-dev \
# to build Mbed TLS using latest gcc version available from Ubuntu
gcc-12 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the list in alphabetical order, it makes it easier to eyeball what's in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix it.

# provides some useful scripts for adding and removing repositories
software-properties-common \
&& case "$(uname -m)" in \
# x86_64 only packages
x86_64) apt-get install -yq \
Expand All @@ -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/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use more indentation when continuing arguments of a command than when starting a new command after &&. Following the established pattern, this line should be intended to 4 spaces, and the list of arguments to apt-get install should be intented to 8 spaces.

&& add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main' -y \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be consistent about putting && at the end or beginning of the line. In this file the convention is end of line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change it.

&& 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,
Expand Down