From 5503ff541cae38952e2d51c6069ab3af7dc4800c Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 23 Apr 2026 08:40:39 +0200 Subject: [PATCH 1/3] SRE-3223 ci: Use DAOS_HTTPS_PROXY and DAOS_NO_PROXY The DAOS_HTTPS_PROXY and DAOS_NO_PROXY variables provided by Jenkins define a complete proxy configurations for CI environment. These variables are converted inside Dockers to Linux native variables NO_PROXY and HTTPS_PROXY. This commit follows #88 with cosmetic changes. Signed-off-by: Tomasz Gromadzki --- Dockerfile.mockbuild | 58 +++++++++++++++++++---------------- scripts/repo-helper-fedora.sh | 5 +++ 2 files changed, 37 insertions(+), 26 deletions(-) mode change 100644 => 100755 scripts/repo-helper-fedora.sh diff --git a/Dockerfile.mockbuild b/Dockerfile.mockbuild index 51d63aa..fdcec8d 100644 --- a/Dockerfile.mockbuild +++ b/Dockerfile.mockbuild @@ -1,6 +1,6 @@ # # Copyright 2018-2024 Intel Corporation -# Copyright 2025 Hewlett Packard Enterprise Development LP +# Copyright 2025-2026 Hewlett Packard Enterprise Development LP # # 'recipe' for Docker to build an RPM # @@ -12,37 +12,43 @@ FROM fedora:$FVERSION ARG FVERSION LABEL maintainer="daos@daos.groups.io" -# Use local repo server if present -ARG REPO_FILE_URL -ARG DAOS_LAB_CA_FILE_URL -ARG REPOSITORY_NAME - -# Accept DAOS_NO_PROXY at build time +# Accept DAOS_HTTP_PROXY, DAOS_HTTPS_PROXY, and DAOS_NO_PROXY at build time ARG DAOS_NO_PROXY -# Propagate into the build environment -ENV no_proxy=${DAOS_NO_PROXY} -ENV NO_PROXY=${DAOS_NO_PROXY} -# Persist into /etc/environment for use by shells and services -RUN echo "no_proxy=${DAOS_NO_PROXY}" >> /etc/environment && \ - echo "NO_PROXY=${DAOS_NO_PROXY}" >> /etc/environment - -# Accept DAOS_HTTPS_PROXY at build time +ARG DAOS_HTTP_PROXY ARG DAOS_HTTPS_PROXY + # Propagate into the build environment -ENV https_proxy=${DAOS_HTTPS_PROXY} -ENV HTTPS_PROXY=${DAOS_HTTPS_PROXY} +ENV http_proxy=${DAOS_HTTP_PROXY} \ + HTTP_PROXY=${DAOS_HTTP_PROXY} \ + https_proxy=${DAOS_HTTPS_PROXY} \ + HTTPS_PROXY=${DAOS_HTTPS_PROXY} \ + no_proxy=${DAOS_NO_PROXY} \ + NO_PROXY=${DAOS_NO_PROXY} + # Persist into /etc/environment for use by shells and services -RUN echo "https_proxy=${DAOS_HTTPS_PROXY}" >> /etc/environment && \ - echo "HTTPS_PROXY=${DAOS_HTTPS_PROXY}" >> /etc/environment +RUN set -e; \ + if [ -n "$DAOS_HTTP_PROXY" ]; then \ + echo "http_proxy=$DAOS_HTTP_PROXY" >> /etc/environment; \ + echo "HTTP_PROXY=$DAOS_HTTP_PROXY" >> /etc/environment; \ + fi; \ + if [ -n "$DAOS_HTTPS_PROXY" ]; then \ + echo "https_proxy=$DAOS_HTTPS_PROXY" >> /etc/environment; \ + echo "HTTPS_PROXY=$DAOS_HTTPS_PROXY" >> /etc/environment; \ + fi; \ + if [ -n "$DAOS_NO_PROXY" ]; then \ + echo "no_proxy=$DAOS_NO_PROXY" >> /etc/environment; \ + echo "NO_PROXY=$DAOS_NO_PROXY" >> /etc/environment; \ + fi -# script to install OS updates basic tools and daos dependencies -# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh -# script to setup local repo if available -COPY ./packaging/scripts/repo-helper-fedora.sh /tmp/repo-helper.sh +# Use local repo server if present +ARG REPO_FILE_URL +ARG DAOS_LAB_CA_FILE_URL +ARG REPOSITORY_NAME -RUN chmod +x /tmp/repo-helper.sh && \ - /tmp/repo-helper.sh && \ - rm -f /tmp/repo-helper.sh +# Script to setup a local repo instead of the distro-provided one. +# Only takes effect when REPO_FILE_URL is set; otherwise it is a no-op. +RUN --mount=type=bind,source=packaging/scripts/repo-helper-fedora.sh,target=/tmp/repo-helper-fedora.sh \ + /tmp/repo-helper-fedora.sh # Install basic tools RUN dnf -y install mock make rpm-build createrepo rpmlint git \ diff --git a/scripts/repo-helper-fedora.sh b/scripts/repo-helper-fedora.sh old mode 100644 new mode 100755 index 028575f..f7d4a4f --- a/scripts/repo-helper-fedora.sh +++ b/scripts/repo-helper-fedora.sh @@ -1,4 +1,9 @@ #!/bin/bash +# +# Copyright 2025-2026 Hewlett Packard Enterprise Development LP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# set -uex # This script is used by Dockerfiles to optionally use From f61be0fb65e416525aee440ca2d8edd2ed4a8d64 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 23 Apr 2026 10:31:37 +0200 Subject: [PATCH 2/3] Add proxy support to Ubuntu build Signed-off-by: Tomasz Gromadzki --- Dockerfile.ubuntu.20.04 | 38 +++++++++++++++++++++++++++++------ scripts/repo-helper-ubuntu.sh | 0 2 files changed, 32 insertions(+), 6 deletions(-) mode change 100644 => 100755 scripts/repo-helper-ubuntu.sh diff --git a/Dockerfile.ubuntu.20.04 b/Dockerfile.ubuntu.20.04 index bd5363b..708a4d8 100644 --- a/Dockerfile.ubuntu.20.04 +++ b/Dockerfile.ubuntu.20.04 @@ -14,15 +14,41 @@ LABEL org.opencontainers.image.authors="daos@daos.groups.io" # Needed for later use of BASE_DISTRO ARG BASE_DISTRO +# Accept DAOS_HTTP_PROXY, DAOS_HTTPS_PROXY, and DAOS_NO_PROXY at build time +ARG DAOS_NO_PROXY +ARG DAOS_HTTP_PROXY +ARG DAOS_HTTPS_PROXY + +# Propagate into the build environment +ENV http_proxy=${DAOS_HTTP_PROXY} \ + HTTP_PROXY=${DAOS_HTTP_PROXY} \ + https_proxy=${DAOS_HTTPS_PROXY} \ + HTTPS_PROXY=${DAOS_HTTPS_PROXY} \ + no_proxy=${DAOS_NO_PROXY} \ + NO_PROXY=${DAOS_NO_PROXY} + +# Persist into /etc/environment for use by shells and services +RUN set -e; \ + if [ -n "$DAOS_HTTP_PROXY" ]; then \ + echo "http_proxy=$DAOS_HTTP_PROXY" >> /etc/environment; \ + echo "HTTP_PROXY=$DAOS_HTTP_PROXY" >> /etc/environment; \ + fi; \ + if [ -n "$DAOS_HTTPS_PROXY" ]; then \ + echo "https_proxy=$DAOS_HTTPS_PROXY" >> /etc/environment; \ + echo "HTTPS_PROXY=$DAOS_HTTPS_PROXY" >> /etc/environment; \ + fi; \ + if [ -n "$DAOS_NO_PROXY" ]; then \ + echo "no_proxy=$DAOS_NO_PROXY" >> /etc/environment; \ + echo "NO_PROXY=$DAOS_NO_PROXY" >> /etc/environment; \ + fi + ARG REPO_FILE_URL ARG DAOS_LAB_CA_FILE_URL ARG REPOSITORY_NAME -# script to setup local repo if available -COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh - -RUN chmod +x /tmp/repo-helper.sh && \ - /tmp/repo-helper.sh && \ - rm -f /tmp/repo-helper.sh +# Script to setup a local repo instead of the distro-provided one. +# Only takes effect when REPO_FILE_URL is set; otherwise it is a no-op. +RUN --mount=type=bind,source=packaging/scripts/repo-helper-ubuntu.sh,target=/tmp/repo-helper-ubuntu.sh \ + /tmp/repo-helper-ubuntu.sh # Install basic tools - rpmdevtools temporary commented out. RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ diff --git a/scripts/repo-helper-ubuntu.sh b/scripts/repo-helper-ubuntu.sh old mode 100644 new mode 100755 From d6a45ef2db5e8263d890e961eb85d2cd68acb930 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 23 Apr 2026 15:41:29 +0200 Subject: [PATCH 3/3] Fix copyright data Signed-off-by: Tomasz Gromadzki Doc-only: true --- Dockerfile.ubuntu.20.04 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.ubuntu.20.04 b/Dockerfile.ubuntu.20.04 index 708a4d8..4484c84 100644 --- a/Dockerfile.ubuntu.20.04 +++ b/Dockerfile.ubuntu.20.04 @@ -3,7 +3,7 @@ # Jenkinsfile will be changed to use Dockerfile.ubuntu. # # Copyright 2019-2021, Intel Corporation -# Copyright 2025 Hewlett Packard Enterprise Development LP +# Copyright 2025-2026 Hewlett Packard Enterprise Development LP # # 'recipe' for Docker to build an Debian package #