-
Notifications
You must be signed in to change notification settings - Fork 288
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
Replace RHEL 7 with CBL-Mariner #1373
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
80163b5
Remove RHEL from official builds.
BillyONeal 594d7ba
WIP bindings
BillyONeal 2e0a02f
wip
BillyONeal 4581a67
wip
BillyONeal 3cd359b
Remove no longer used managed image json files.
BillyONeal 6377422
Remove RHEL references.
BillyONeal d67ffa4
Name the managed identity.
BillyONeal 07373ce
Supply VCPKG_VERSION from the pipeline rather than asking git to do it.
BillyONeal c5675bf
Don't upload temporary build bits.
BillyONeal 7bdf375
Add mkdir p
BillyONeal 7fb3830
Reduce the using supplied SHA message to 'status'
BillyONeal 81f625c
Remove duplicate signature check and add more install retries.
BillyONeal 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 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
This file contains 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
This file contains 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,17 +1,3 @@ | ||
FROM vcpkgdockercontainers.azurecr.io/vcpkg/alpine:3.11 | ||
FROM vcpkgdockercontainers.azurecr.io/vcpkg/alpine:3.16 | ||
|
||
RUN apk add alpine-sdk cmake ninja git curl tar gzip zip | ||
|
||
COPY . /source | ||
|
||
ARG FMT_TARBALL_URL | ||
|
||
ARG CMAKERC_TARBALL_URL | ||
|
||
ARG VCPKG_BASE_VERSION | ||
|
||
ARG VCPKG_STANDALONE_BUNDLE_SHA | ||
|
||
RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_CXX_FLAGS="-static -s -static-libgcc -static-libstdc++" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" "-DVCPKG_FMT_URL=$FMT_TARBALL_URL" "-DVCPKG_CMAKERC_URL=$CMAKERC_TARBALL_URL" -S /source -B /build 2>&1 | ||
|
||
RUN ninja -C build |
This file contains 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This infrastructure is adapted from that the .NET team uses, see | ||
# https://github.com/dotnet/dotnet-buildtools-prereqs-docker | ||
# and | ||
# https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md | ||
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 | ||
|
||
RUN tdnf install -y \ | ||
# Common utilities | ||
ca-certificates \ | ||
git \ | ||
tar \ | ||
curl \ | ||
# Build tools | ||
binutils \ | ||
cmake \ | ||
ninja-build \ | ||
# Rootfs build dependencies | ||
bzip2-devel \ | ||
debootstrap \ | ||
libarchive-devel \ | ||
openssl-devel | ||
|
||
# Obtain ubuntu package signing key (for use by debootstrap) | ||
# 1. Download the ubuntu keyrings | ||
RUN curl -L -o ubuntu-keyring_2021.03.26.tar.gz https://mirrors.edge.kernel.org/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2021.03.26.tar.gz && \ | ||
# 2. Check that they have the correct SHA | ||
echo "492eed5c06408c6f632577adb0796130af5d6542013ef418f47187a209e49bb1 ubuntu-keyring_2021.03.26.tar.gz" | sha256sum -c && \ | ||
tar xf ubuntu-keyring_2021.03.26.tar.gz && \ | ||
rm ubuntu-keyring_2021.03.26.tar.gz && \ | ||
# 3. Install the needed keyring and delete the rest | ||
pushd ubuntu-keyring-2021.03.26 && \ | ||
mkdir -p /usr/share/keyrings && \ | ||
mv keyrings/ubuntu-archive-keyring.gpg /usr/share/keyrings && \ | ||
popd && \ | ||
rm -r ubuntu-keyring-2021.03.26 | ||
|
||
# Build the 'crossrootfs' | ||
# Note that we only need libstdc++-9-dev rather than all of g++-9, but choosing g++-9 | ||
# gets other optional dependencies to agree with g++-9 rather than older gccs | ||
RUN debootstrap "--variant=minbase" --force-check-gpg --arch amd64 xenial /crossrootfs/x64 http://archive.ubuntu.com/ubuntu/ | ||
COPY sources.list . | ||
RUN chroot /crossrootfs/x64 apt-get clean && \ | ||
cp /etc/resolv.conf /crossrootfs/x64/etc/resolv.conf && \ | ||
cp sources.list /crossrootfs/x64/etc/apt/sources.list && \ | ||
chroot /crossrootfs/x64 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F && \ | ||
chroot /crossrootfs/x64 apt-get update -o Acquire::CompressionTypes::Order::=gz | ||
|
||
# Repeated runs of apt-get install workaround 'hash sum mismatch' errors | ||
# (This is also why these are a separate cache layer) | ||
RUN chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" && \ | ||
chroot /crossrootfs/x64 symlinks -cr /usr && \ | ||
chroot /crossrootfs/x64 apt-get clean |
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
deb http://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu xenial main | ||
deb-src http://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu xenial main | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse |
This file contains 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(LINUX 1) | ||
set(CMAKE_SYSTEM_VERSION 1) | ||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
set(CMAKE_SYSROOT "/crossrootfs/x64") | ||
set(C_HEADER_ARGS "-B/crossrootfs/x64/usr/lib/x86_64-linux-gnu/ -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include -isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu -isystem /crossrootfs/x64/usr/include") | ||
set(CMAKE_C_FLAGS_INIT "${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc") | ||
set(CMAKE_CXX_FLAGS_INIT "-isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu/c++/9 -isystem /crossrootfs/x64/usr/include/c++/9 ${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc -static-libstdc++ -L/crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/") | ||
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
function(add_toolchain_linker_flag Flag) | ||
set("CMAKE_EXE_LINKER_FLAGS_INIT" "${CMAKE_EXE_LINKER_FLAGS_INIT} ${Flag}" PARENT_SCOPE) | ||
set("CMAKE_SHARED_LINKER_FLAGS_INIT" "${CMAKE_SHARED_LINKER_FLAGS_INIT} ${Flag}" PARENT_SCOPE) | ||
endfunction() | ||
|
||
add_toolchain_linker_flag("-Wl,--rpath-link=/crossrootfs/x64/lib/x86_64-linux-gnu") | ||
add_toolchain_linker_flag("-Wl,--rpath-link=/crossrootfs/x64/usr/lib/x86_64-linux-gnu") | ||
|
||
set(CMAKE_C_COMPILER /usr/bin/gcc) | ||
set(CMAKE_CXX_COMPILER /usr/bin/g++) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion, not required]
When using apt, best practices are usually to:
This is all done in a single RUN step to minimize the size of the produced image.
Is something similar we should be doing for tdnf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yum (and dnf (and tdnf)), to my understanding, does not have separate fetch indexes / install commands