-
Notifications
You must be signed in to change notification settings - Fork 7
chore: reduce COPY's and wget's #814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rjaegers
wants to merge
24
commits into
main
Choose a base branch
from
feature/reduce-unnecessary-copy-and-wget
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+78
−35
Draft
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
41e6ff7
chore: reduce COPY's and wget's
rjaegers 8624c61
chore: fix build issue
rjaegers 0b2e86f
chore: test-drive multi-stage downloads
rjaegers ca8c04b
chore: fix warnings and build error
rjaegers 620626a
chore: more fixing
rjaegers 9188d3f
chore: move extraction of archive
rjaegers 73cfe9a
chore: fix arg reference
rjaegers 7af1004
chore: re-fix arg usage
rjaegers 5114443
chore: fix extraction
rjaegers c6fd52e
chore: squash another layer
rjaegers 5831465
chore: add checksums to gpg keys
rjaegers f389335
chore: fix line continuation
rjaegers eafb9d5
chore: fix an "it was late"
rjaegers 4a88582
chore: correct installation of certificate
rjaegers a45aba4
chore: move download of arm gcc toolchain to separate stage
rjaegers a1d0653
chore: fix gcc-arm-none-eabi install
rjaegers a448ac3
chore: hoist-up xwin as well
rjaegers 0e504ff
chore: hoist-up bats installation
rjaegers d92864e
chore: reduce number of layers
rjaegers b9daef1
Merge branch 'main' into feature/reduce-unnecessary-copy-and-wget
rjaegers f906441
Merge branch 'main' into feature/reduce-unnecessary-copy-and-wget
rjaegers 4372863
Merge branch 'main' into feature/reduce-unnecessary-copy-and-wget
rjaegers 5a8e0b4
Merge branch 'main' into feature/reduce-unnecessary-copy-and-wget
rjaegers f761eb4
Merge branch 'main' into feature/reduce-unnecessary-copy-and-wget
rjaegers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,28 @@ | ||
| FROM scratch AS downloader-amd64 | ||
| ADD --checksum=sha256:53dc06dc3f775282ddff93b2d0974bbe6480761018c61e7a797342a9c7f14e23 \ | ||
| https://download.docker.com/linux/static/stable/x86_64/docker-28.2.2.tgz /docker.tgz | ||
|
||
|
|
||
| FROM scratch AS downloader-arm64 | ||
| ADD --checksum=sha256:c9506628d1845c69230df3d87e2eedd7980caf8bd966f5e6a5d7a2364de42497 \ | ||
| https://download.docker.com/linux/static/stable/aarch64/docker-28.2.2.tgz /docker.tgz | ||
|
|
||
| FROM downloader-$TARGETARCH AS downloader | ||
|
||
| ADD --checksum=sha256:ce6eee4130298f79b0e0f09a89f93c1bc711cd68e7e3182d37c8e96c5227e2f0 \ | ||
| https://apt.llvm.org/llvm-snapshot.gpg.key /llvm.gpg.key | ||
| ADD --checksum=sha256:db2938ce5fd422f2db7a07508452772c945135d99274004c462190c323fefcf1 \ | ||
| https://dl.cloudsmith.io/public/mull-project/mull-stable/gpg.41DB35380DE6BD6F.key /mull.gpg.key | ||
|
|
||
| FROM ubuntu:24.04@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233 AS extractor | ||
|
|
||
| RUN --mount=from=downloader,target=/dl \ | ||
| tar xzf /dl/docker.tgz -C /tmp | ||
|
|
||
| FROM ubuntu:24.04@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233 | ||
|
|
||
| ARG BATS_VERSION=1.11.0 | ||
| ARG CCACHE_VERSION=4.11 | ||
| ARG CLANG_VERSION=18 | ||
| ARG CPM_VERSION=0.40.2 | ||
| ARG DOCKER_VERSION=27.3.1 | ||
| ARG INCLUDE_WHAT_YOU_USE_VERSION=0.22 | ||
| ARG XWIN_VERSION=0.6.5 | ||
|
|
||
|
|
@@ -14,22 +32,20 @@ | |
|
|
||
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
|
||
| # Include the Cisco Umbrella PKI Root | ||
| ADD --checksum=sha256:a122d4080a26c1da986bd0e7202b1630eb661a624915ef244f496fdd306e85fb \ | ||
| https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem /usr/local/share/ca-certificates/ciscoumbrellaroot.pem | ||
|
||
|
|
||
| # Install the base system with all tool dependencies | ||
| COPY .devcontainer/cpp/apt-requirements-base.json /tmp/apt-requirements-base.json | ||
| # Some tools are installed via pip to get more recent versions | ||
| # hadolint ignore=DL3008 | ||
| RUN apt-get update && apt-get install -y --no-install-recommends jq \ | ||
| RUN --mount=type=bind,source=.devcontainer/cpp/apt-requirements-base.json,target=/tmp/apt-requirements-base.json \ | ||
| --mount=type=bind,source=.devcontainer/cpp/requirements.txt,target=/tmp/requirements.txt \ | ||
| apt-get update && apt-get install -y --no-install-recommends jq \ | ||
| && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | xargs apt-get install -y --no-install-recommends \ | ||
| && rm /tmp/apt-requirements-base.json \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Include the Cisco Umbrella PKI Root | ||
| RUN wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \ | ||
| && update-ca-certificates | ||
|
|
||
| # Install some tools via pip to get more recent versions | ||
| COPY .devcontainer/cpp/requirements.txt /tmp/requirements.txt | ||
| RUN python3 -m pip install --break-system-packages --require-hashes --no-cache-dir -r /tmp/requirements.txt \ | ||
| && rm -rf /tmp/requirements.txt | ||
| && update-ca-certificates \ | ||
| && python3 -m pip install --break-system-packages --require-hashes --no-cache-dir -r /tmp/requirements.txt \ | ||
| && rm -rf /var/cache/apt/archives /var/lib/apt/lists/* | ||
|
|
||
| # Set default environment options for CMake and ccache | ||
| ENV CMAKE_GENERATOR="Ninja" | ||
|
|
@@ -38,18 +54,18 @@ | |
| ENV CPM_SOURCE_CACHE=/cache/.cpm-cache | ||
|
|
||
| # Install clang toolchain and mull mutation testing framework | ||
| COPY .devcontainer/cpp/apt-requirements-clang.json /tmp/apt-requirements-clang.json | ||
| # hadolint ignore=SC1091 | ||
| RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot-keyring.gpg \ | ||
| && wget -qO - https://dl.cloudsmith.io/public/mull-project/mull-stable/gpg.41DB35380DE6BD6F.key | gpg --dearmor -o /usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg \ | ||
| RUN --mount=type=bind,source=.devcontainer/cpp/apt-requirements-clang.json,target=/tmp/apt-requirements-clang.json \ | ||
| --mount=from=downloader,target=/keys \ | ||
| echo /keys/llvm.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot-keyring.gpg \ | ||
| && echo /keys/mull.gpg.key | gpg --dearmor -o /usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg \ | ||
| && UBUNTU_CODENAME=$(. /etc/os-release; echo "${UBUNTU_CODENAME/*, /}") \ | ||
| && echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot-keyring.gpg] http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list > /dev/null \ | ||
| && echo "deb [signed-by=/usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/mull-project/mull-stable/deb/ubuntu ${UBUNTU_CODENAME} main" | tee /etc/apt/sources.list.d/mull-project-mull-stable.list > /dev/null \ | ||
| && echo -e 'Package: *\nPin: origin "apt.llvm.org"\nPin-Priority: 1000' > /etc/apt/preferences \ | ||
| && apt-get update \ | ||
| && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-clang.json | xargs apt-get install -y --no-install-recommends \ | ||
| && rm /tmp/apt-requirements* \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| && rm -rf /var/cache/apt/archives /var/lib/apt/lists/* | ||
| ENV PATH="$PATH:/usr/lib/llvm-${CLANG_VERSION}/bin" | ||
|
|
||
| # Install arm-gcc toolchain | ||
|
|
@@ -58,9 +74,7 @@ | |
| ENV PATH="$PATH:/opt/gcc-arm-none-eabi/bin" | ||
|
|
||
| # Install docker-cli for Docker-from-Docker tools | ||
| RUN wget -qO - "https://download.docker.com/linux/static/stable/$(uname -m)/docker-${DOCKER_VERSION}.tgz" | tar xz -C /tmp \ | ||
| && mv /tmp/docker/docker /usr/local/bin/ \ | ||
| && rm -rf /tmp/docker | ||
| COPY --from=extractor /tmp/docker/docker /usr/local/bin | ||
|
|
||
| # Install bats | ||
| RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \ | ||
|
|
@@ -88,7 +102,7 @@ | |
| && CC=clang CXX=clang++ cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION} -B /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION}/build \ | ||
| && cmake --build /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION}/build --target install \ | ||
| && rm -rf /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION} \ | ||
| && apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libsqlite3-dev \ | ||
| && apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev \ | ||
| && apt-get autoremove -y \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.