diff --git a/CODEOWNERS b/CODEOWNERS index 672604700..78dbff6fa 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -41,8 +41,7 @@ src/fedora/**/amd64/ @dotnet/source-build @dotnet/dotnet-docker-reviewers src/ubuntu/**/debpkg/ @dotnet/runtime-infrastructure @dotnet/dotnet-docker-reviewers src/ubuntu/22.04/mlnet/ @dotnet/runtime-infrastructure @dotnet/dotnet-docker-reviewers src/ubuntu/22.04/opt/arm64v8/ @dotnet/runtime-infrastructure @dotnet/dotnet-docker-reviewers -src/ubuntu/common/coredeps/ @dotnet/runtime-infrastructure @dotnet/dotnet-docker-reviewers -src/ubuntu/20.04/amd64/ @dotnet/source-build @dotnet/dotnet-docker-reviewers +src/ubuntu/22.04/coredeps/amd64/ @dotnet/runtime-infrastructure @dotnet/dotnet-docker-reviewers src/ubuntu/22.04/amd64/ @dotnet/source-build @dotnet/dotnet-docker-reviewers src/ubuntu/24.04/Dockerfile @dotnet/source-build @dotnet/dotnet-docker-reviewers diff --git a/src/ubuntu/20.04/amd64/Dockerfile b/src/ubuntu/20.04/amd64/Dockerfile deleted file mode 100644 index a48e90a90..000000000 --- a/src/ubuntu/20.04/amd64/Dockerfile +++ /dev/null @@ -1,68 +0,0 @@ -FROM ubuntu.azurecr.io/ubuntu:20.04 - -# Install the base toolchain we need to build anything (clang, cmake, make and the like) -# this does not include libraries that we need to compile different projects, we'd like -# them in a different layer. -RUN apt-get update \ - && apt-get install -y \ - cmake \ - clang-12 \ - gdb \ - liblldb-12-dev \ - lldb-12 \ - llvm-12 \ - locales \ - make \ - pigz \ - sudo \ - wget \ - && rm -rf /var/lib/apt/lists/* - -# Install tools used by the VSO build automation. -RUN apt-get update \ - && apt-get install -y \ - git \ - nodejs \ - npm \ - tar \ - zip \ - curl \ - && rm -rf /var/lib/apt/lists/* \ - # npm installs a vulnerable node-ip pkg. Upgrading the node-ip pkg requires Ubuntu PRO subscription. Workaround by using NPM. - && npm install -g ip@latest - -# .NET SDK MSBuild requires US.UTF-8 locale to execute tasks -RUN locale-gen en_US.UTF-8 - -# Install Azure CLI - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-1-install-with-one-command -RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash \ - # Install script does apt-get update and install, so we need to clean up after it. - && rm -rf /var/lib/apt/lists/* - -# Runtime dependencies -RUN apt-get update \ - && apt-get install -y \ - autoconf \ - automake \ - curl \ - build-essential \ - gettext \ - jq \ - libicu-dev \ - libkrb5-dev \ - liblttng-ust-dev \ - libnuma-dev \ - libssl-dev \ - libtool \ - libunwind8 \ - libunwind8-dev \ - uuid-dev \ - zlib1g-dev \ - && rm -rf /var/lib/apt/lists/* - -# Dependencies for VMR/source-build tests -RUN apt-get update \ - && apt-get install -y \ - elfutils \ - file \ - && rm -rf /var/lib/apt/lists/* diff --git a/src/ubuntu/20.04/helix/Dockerfile b/src/ubuntu/20.04/helix/Dockerfile deleted file mode 100644 index 357c8732e..000000000 --- a/src/ubuntu/20.04/helix/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -FROM ubuntu.azurecr.io/ubuntu:20.04 - -# Install Helix Dependencies -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && \ - apt-get install -qq -y \ - autoconf \ - automake \ - build-essential \ - cmake \ - clang \ - curl \ - gcc \ - gdb \ - git \ - gss-ntlmssp \ - iputils-ping \ - libcurl4 \ - libffi-dev \ - libicu-dev \ - libssl-dev \ - libtool \ - libunwind8 \ - libunwind-dev \ - lldb-3.9 \ - llvm \ - locales \ - locales-all \ - python3.9-dev \ - python3-pip \ - python3.9-venv \ - software-properties-common \ - sudo \ - tzdata \ - unzip \ - zlib1g-dev \ - && rm -rf /var/lib/apt/lists/* \ - \ - && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 - -ENV LANG=en_US.utf8 - -RUN ln -sf /usr/bin/python3.9 /usr/bin/python - -# Add MsQuic -RUN curl -LO https://packages.microsoft.com/keys/microsoft.asc && \ - echo 2cfd20a306b2fa5e25522d78f2ef50a1f429d35fd30bd983e2ebffc2b80944fa microsoft.asc| sha256sum --check - && \ - apt-key add microsoft.asc && \ - rm microsoft.asc && \ - apt-add-repository https://packages.microsoft.com/ubuntu/20.04/prod && \ - apt-get update && \ - apt-get install -y libmsquic && \ - rm -rf /var/lib/apt/lists/* - -# create helixbot user and give rights to sudo without password -RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot && \ - chmod 755 /root && \ - echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot - -USER helixbot -WORKDIR /home/helixbot -ENV VIRTUAL_ENV=/home/helixbot/.vsts-env - -RUN python -m venv $VIRTUAL_ENV && \ - ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ - ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ - rm ./helix_scripts-*-py3-none-any.whl -ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" diff --git a/src/ubuntu/20.04/helix/sqlserver/amd64/Dockerfile b/src/ubuntu/20.04/helix/sqlserver/amd64/Dockerfile deleted file mode 100644 index 5ab8eb46b..000000000 --- a/src/ubuntu/20.04/helix/sqlserver/amd64/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-amd64 - -USER root - -# Install SqlServer 2019 and FTS -RUN apt-get update \ - && apt-get install -qq -y \ - software-properties-common \ - wget \ - && wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)" \ - && apt-get update \ - && apt-get install -qq -y \ - mssql-server \ - mssql-server-fts \ - && rm -rf /var/lib/apt/lists/* - - # Create new user group and add helixbot to it. This user group will have permission to folders which are needed for SqlServer -RUN groupadd -g 1000 sqlserver_users \ - && usermod -a -G sqlserver_users helixbot \ - # Create required directory to avoid giving permission to / - && mkdir /var/opt/mssql/.system/system \ - && chgrp -R sqlserver_users /var/opt/mssql \ - && chmod -R 770 /var/opt/mssql - -CMD ["/opt/mssql/bin/sqlservr"] - -USER helixbot diff --git a/src/ubuntu/20.04/helix/wasm/amd64/Dockerfile b/src/ubuntu/20.04/helix/wasm/amd64/Dockerfile deleted file mode 100644 index 12e49f6d3..000000000 --- a/src/ubuntu/20.04/helix/wasm/amd64/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-amd64 - -ENV DEBIAN_FRONTEND=noninteractive - -# Need some additional packages - -USER root - -RUN apt-get clean && \ - mv /etc/apt/sources.list /etc/apt/sources.list1 && apt-get update && \ - mv /etc/apt/sources.list1 /etc/apt/sources.list && apt-get update && \ - apt-get install -qq -y \ - libnode-dev \ - curl \ - node-gyp \ - && rm -rf /var/lib/apt/lists/* \ - \ - && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 - -# update node, which is required for newer npm, jsvu and v8 -COPY ./setup-node-23.x.sh /tmp -RUN /tmp/setup-node-23.x.sh && apt-get -y install nodejs - -RUN npm install -g npm - -# Install latest V8 engine -ENV PATH="/home/helixbot/.jsvu/bin:${PATH}" -RUN npm install jsvu -g \ - && su helixbot -c "jsvu --os=linux64 --engines=v8" \ - && v8 -e "console.log(version());quit();" \ - && npm uninstall jsvu -g - -USER helixbot diff --git a/src/ubuntu/20.04/helix/wasm/amd64/setup-node-23.x.sh b/src/ubuntu/20.04/helix/wasm/amd64/setup-node-23.x.sh deleted file mode 100755 index 4a07a0b0b..000000000 --- a/src/ubuntu/20.04/helix/wasm/amd64/setup-node-23.x.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# Extracted from https://deb.nodesource.com/setup_23.x - -# Logger Function -log() { - local message="$1" - local type="$2" - local timestamp=$(date '+%Y-%m-%d %H:%M:%S') - local color - local endcolor="\033[0m" - - case "$type" in - "info") color="\033[38;5;79m" ;; - "success") color="\033[1;32m" ;; - "error") color="\033[1;31m" ;; - *) color="\033[1;34m" ;; - esac - - echo -e "${color}${timestamp} - ${message}${endcolor}" -} - -# Error handler function -handle_error() { - local exit_code=$1 - local error_message="$2" - log "Error: $error_message (Exit Code: $exit_code)" "error" - exit $exit_code -} - -# Function to check for command availability -command_exists() { - command -v "$1" &> /dev/null -} - -check_os() { - if ! [ -f "/etc/debian_version" ]; then - echo "Error: This script is only supported on Debian-based systems." - exit 1 - fi -} - -# Function to Install the script pre-requisites -install_pre_reqs() { - log "Installing pre-requisites" "info" - - # Run 'apt-get update' - if ! apt-get update -y; then - handle_error "$?" "Failed to run 'apt-get update'" - fi - - # Run 'apt-get install' - if ! apt-get install -y apt-transport-https ca-certificates curl gnupg; then - handle_error "$?" "Failed to install packages" - fi - - if ! mkdir -p /usr/share/keyrings; then - handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" - fi - - rm -f /usr/share/keyrings/nodesource.gpg || true - rm -f /etc/apt/sources.list.d/nodesource.list || true - - # Run 'curl' and 'gpg' to download and import the NodeSource signing key - if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then - handle_error "$?" "Failed to download and import the NodeSource signing key" - fi - - # Explicitly set the permissions to ensure the file is readable by all - if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then - handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" - fi -} - -# Function to configure the Repo -configure_repo() { - local node_version=$1 - - arch=$(dpkg --print-architecture) - if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then - handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported." - fi - - echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null - - # N|solid Config - echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null - echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null - echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null - - # Nodejs Config - echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null - echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null - echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null - - # Run 'apt-get update' - if ! apt-get update -y; then - handle_error "$?" "Failed to run 'apt-get update'" - else - log "Repository configured successfully." - log "To install Node.js, run: apt-get install nodejs -y" "info" - log "You can use N|solid Runtime as a node.js alternative" "info" - log "To install N|solid Runtime, run: apt-get install nsolid -y \n" "success" - fi -} - -# Define Node.js version -NODE_VERSION="23.x" - -# Check OS -check_os - -# Main execution -install_pre_reqs || handle_error $? "Failed installing pre-requisites" -configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" diff --git a/src/ubuntu/common/coredeps/Dockerfile b/src/ubuntu/22.04/coredeps/amd64/Dockerfile similarity index 92% rename from src/ubuntu/common/coredeps/Dockerfile rename to src/ubuntu/22.04/coredeps/amd64/Dockerfile index c43824b1d..e8cb04f12 100644 --- a/src/ubuntu/common/coredeps/Dockerfile +++ b/src/ubuntu/22.04/coredeps/amd64/Dockerfile @@ -1,5 +1,4 @@ -ARG POWERSHELL_TAG -FROM mcr.microsoft.com/powershell:$POWERSHELL_TAG +FROM mcr.microsoft.com/powershell:ubuntu-22.04 # Install tools used by the AzDO build automation. RUN apt-get update \ diff --git a/src/ubuntu/manifest.json b/src/ubuntu/manifest.json index 7fcf5e9d9..b83989779 100644 --- a/src/ubuntu/manifest.json +++ b/src/ubuntu/manifest.json @@ -3,88 +3,6 @@ { "name": "dotnet-buildtools/prereqs", "images": [ - { - "platforms": [ - { - "dockerfile": "src/ubuntu/common/coredeps", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04-coredeps": {}, - "ubuntu-20.04-coredeps-amd64": {} - }, - "buildArgs": { - "POWERSHELL_TAG": "ubuntu-20.04" - } - } - ] - }, - { - "platforms": [ - { - "architecture": "amd64", - "dockerfile": "src/ubuntu/20.04/helix", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04-helix-amd64": {} - } - } - ] - }, - { - "platforms": [ - { - "architecture": "arm64", - "dockerfile": "src/ubuntu/20.04/helix", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04-helix-arm64v8": {} - }, - "variant": "v8" - } - ] - }, - { - "platforms": [ - { - "architecture": "amd64", - "dockerfile": "src/ubuntu/20.04/helix/wasm/amd64", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04-helix-wasm-amd64": {} - } - } - ] - }, - { - "platforms": [ - { - "architecture": "amd64", - "dockerfile": "src/ubuntu/20.04/helix/sqlserver/amd64", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04-helix-sqlserver-amd64": {} - } - } - ] - }, - { - "platforms": [ - { - "dockerfile": "src/ubuntu/20.04/amd64", - "os": "linux", - "osVersion": "focal", - "tags": { - "ubuntu-20.04": {}, - "ubuntu-20.04-amd64": {} - } - } - ] - }, { "platforms": [ { @@ -101,15 +19,12 @@ { "platforms": [ { - "dockerfile": "src/ubuntu/common/coredeps", + "dockerfile": "src/ubuntu/22.04/coredeps/amd64", "os": "linux", "osVersion": "jammy", "tags": { "ubuntu-22.04-coredeps": {}, "ubuntu-22.04-coredeps-amd64": {} - }, - "buildArgs": { - "POWERSHELL_TAG": "ubuntu-22.04" } } ]