diff --git a/src/azurelinux/3.0/helix/Dockerfile b/src/azurelinux/3.0/helix/Dockerfile index ff01a31d9..a96c67ae7 100644 --- a/src/azurelinux/3.0/helix/Dockerfile +++ b/src/azurelinux/3.0/helix/Dockerfile @@ -1,17 +1,66 @@ -FROM mcr.microsoft.com/azurelinux/base/core:3.0 - -# Install Helix Dependencies +FROM mcr.microsoft.com/azurelinux/base/core:3.0 as msquic +ARG TARGETARCH ENV LANG=en_US.utf8 -RUN tdnf install --setopt tsflags=nodocs --refresh -y \ +# build MsQuic as we don't have packages +RUN tdnf install --refresh -y \ + binutils \ build-essential \ ca-certificates-microsoft \ + cmake \ + gcc-c++ \ gcc \ + git \ + libnuma-devel \ + kernel-headers \ + lttng-ust-devel \ + make \ + openssl-devel \ + perl + +RUN git clone --depth 1 --single-branch --branch v2.4.1 --recursive https://github.com/microsoft/msquic /tmp/msquic + +WORKDIR /tmp/msquic + +RUN cmake -B build/linux/Release_openssl3 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TARGET_ARCHITECTURE=${TARGETARCH} \ + -DQUIC_TLS=openssl3 \ + -DQUIC_ENABLE_LOGGING=true \ + -DQUIC_USE_SYSTEM_LIBCRYPTO=true \ + -DQUIC_BUILD_TOOLS=off \ + -DQUIC_BUILD_TEST=off \ + -DQUIC_BUILD_PERF=off && \ + cmake --build build/linux/Release_openssl3 --config Release && \ + cmake --install build/linux/Release_openssl3 --prefix /msquic + +FROM mcr.microsoft.com/azurelinux/base/core:3.0 as venv + +RUN tdnf install --refresh -y \ + build-essential \ + ca-certificates-microsoft \ + gcc \ + iputils \ + python3 \ + python3-devel \ + python3-pip + +RUN python3 -m venv /venv && \ + source /venv/bin/activate && \ + pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ + pip install ./helix_scripts-*-py3-none-any.whl + + +FROM mcr.microsoft.com/azurelinux/base/core:3.0 + +# Install .NET and test dependencies +RUN tdnf install --setopt tsflags=nodocs --refresh -y \ + ca-certificates-microsoft \ icu \ iputils \ llvm \ - python3-devel \ + python3 \ python3-pip \ shadow-utils \ tar \ @@ -19,11 +68,9 @@ RUN tdnf install --setopt tsflags=nodocs --refresh -y \ which \ && tdnf clean all -RUN ln -sf /usr/bin/python3 /usr/bin/python && \ - python -m pip install --upgrade setuptools && \ - pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ - pip install ./helix_scripts-*-py3-none-any.whl && \ - rm ./helix_scripts-*-py3-none-any.whl + +# Copy msquic from the msquic image into our image that will run on Helix +COPY --from=msquic /msquic /usr # create helixbot user and give rights to sudo without password RUN /usr/sbin/useradd -c '' --uid 1000 --shell /bin/bash --groups adm helixbot && \ @@ -33,4 +80,8 @@ RUN /usr/sbin/useradd -c '' --uid 1000 --shell /bin/bash --groups adm helixbot & USER helixbot -RUN python -m venv /home/helixbot/.vsts-env +# Install Helix Dependencies +ENV VIRTUAL_ENV=/home/helixbot/.vsts-env +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +COPY --from=venv /venv $VIRTUAL_ENV