ci: Pull ubuntu:noble image from our internal docker registry to build ubuntu images

- This is to overcome the issue of pull rate limits from DockerHub
        - Make Ubuntu base image configurable via build-arg
This commit is contained in:
Shubhika Garg
2026-02-23 16:34:06 +01:00
parent 520360a629
commit 0a9c3a07eb
14 changed files with 41 additions and 18 deletions
+8 -2
View File
@@ -372,12 +372,16 @@ class Containerize():
for image,pattern,name,option in imageNames: for image,pattern,name,option in imageNames:
cmd.run(f"{self.cli} image rm {name}:{imageTag}", reportNonZero=False) cmd.run(f"{self.cli} image rm {name}:{imageTag}", reportNonZero=False)
cmd.run(f'docker login -u oaicicd -p oaicicd {DEFAULT_REGISTRY}')
ubuntuImage = "ubuntu:noble"
# Build the base image only on Push Events (not on Merge Requests) # Build the base image only on Push Events (not on Merge Requests)
# On when the base image docker file is being modified. # On when the base image docker file is being modified.
if forceBaseImageBuild: if forceBaseImageBuild:
cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}") cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}")
logfile = f'{lSourcePath}/cmake_targets/log/ran-base.docker.log' logfile = f'{lSourcePath}/cmake_targets/log/ran-base.docker.log'
cmd.run(f"{self.cli} build {self.cliBuildOptions} --target {baseImage} --tag {baseImage}:{baseTag} --file docker/Dockerfile.base{self.dockerfileprefix} . &> {logfile}", timeout=1600) if self.host == 'Ubuntu':
option = f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
cmd.run(f"{self.cli} build {self.cliBuildOptions} --target {baseImage} --tag {baseImage}:{baseTag} --file docker/Dockerfile.base{self.dockerfileprefix} {option} . &> {logfile}", timeout=1600)
t = ("ran-base", archiveArtifact(cmd, ctx, logfile)) t = ("ran-base", archiveArtifact(cmd, ctx, logfile))
log_files.append(t) log_files.append(t)
@@ -420,6 +424,8 @@ class Containerize():
if image == 'oai-gnb-aerial': if image == 'oai-gnb-aerial':
cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2026.01.07.tar.gz .') cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2026.01.07.tar.gz .')
logfile = f'{lSourcePath}/cmake_targets/log/{name}.docker.log' logfile = f'{lSourcePath}/cmake_targets/log/{name}.docker.log'
if self.host == 'Ubuntu':
option = option + f" --build-arg UBUNTU_IMAGE={DEFAULT_REGISTRY}/{ubuntuImage}"
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > {logfile} 2>&1', timeout=1200) ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > {logfile} 2>&1', timeout=1200)
t = (name, archiveArtifact(cmd, ctx, logfile)) t = (name, archiveArtifact(cmd, ctx, logfile))
log_files.append(t) log_files.append(t)
@@ -446,7 +452,7 @@ class Containerize():
allImagesSize[name] = 'unknown' allImagesSize[name] = 'unknown'
# Now pruning dangling images in between target builds # Now pruning dangling images in between target builds
cmd.run(f"{self.cli} image prune --force") cmd.run(f"{self.cli} image prune --force")
cmd.run(f'docker logout {DEFAULT_REGISTRY}')
# Remove all intermediate build images and clean up # Remove all intermediate build images and clean up
cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag} ran-build-fhi72:{imageTag} || true") cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag} ran-build-fhi72:{imageTag} || true")
cmd.run(f"{self.cli} volume prune --force") cmd.run(f"{self.cli} volume prune --force")
+3 -1
View File
@@ -26,7 +26,9 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM ubuntu:noble AS ran-base ARG UBUNTU_IMAGE=ubuntu:noble
FROM ${UBUNTU_IMAGE} AS ran-base
ARG NEEDED_GIT_PROXY ARG NEEDED_GIT_PROXY
ARG TARGETARCH ARG TARGETARCH
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
+2 -1
View File
@@ -26,7 +26,8 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Very important, the noble image shall not be using mirrors. A lot of them do NOT support ARM64. # Very important, the noble image shall not be using mirrors. A lot of them do NOT support ARM64.
FROM ubuntu:noble AS ran-base ARG UBUNTU_IMAGE=ubuntu:noble
FROM ${UBUNTU_IMAGE} AS ran-base
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
# Specifying a working version of SIMDE for ARM: # Specifying a working version of SIMDE for ARM:
+3 -1
View File
@@ -24,6 +24,7 @@
# Valid for Ubuntu 24.04 # Valid for Ubuntu 24.04
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS enb-base FROM ran-base:latest AS enb-base
@@ -31,7 +32,8 @@ FROM ran-build:latest AS enb-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-enb FROM ${UBUNTU_IMAGE} AS oai-enb
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
+2 -1
View File
@@ -25,6 +25,7 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS ran-build FROM ran-base:latest AS ran-build
RUN apt-get update && \ RUN apt-get update && \
@@ -59,7 +60,7 @@ RUN /bin/sh oaienv && \
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-gnb-aerial FROM ${UBUNTU_IMAGE} AS oai-gnb-aerial
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
@@ -25,6 +25,8 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS ran-build FROM ran-base:latest AS ran-build
RUN apt-get update && \ RUN apt-get update && \
@@ -58,7 +60,7 @@ RUN /bin/sh oaienv && \
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-gnb-aerial FROM ${UBUNTU_IMAGE} AS oai-gnb-aerial
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
+2 -1
View File
@@ -25,6 +25,7 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS gnb-base FROM ran-base:latest AS gnb-base
FROM ran-build:latest AS gnb-build FROM ran-build:latest AS gnb-build
@@ -38,7 +39,7 @@ RUN /bin/sh oaienv && \
./build_oai -w AW2SORI -t Ethernet ./build_oai -w AW2SORI -t Ethernet
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-gnb-aw2s FROM ${UBUNTU_IMAGE} AS oai-gnb-aw2s
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
+2 -1
View File
@@ -24,6 +24,7 @@
# Valid for Ubuntu24.04 # Valid for Ubuntu24.04
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS gnb-base FROM ran-base:latest AS gnb-base
@@ -31,7 +32,7 @@ FROM ran-build-fhi72:latest AS gnb-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-gnb FROM ${UBUNTU_IMAGE} AS oai-gnb
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
+2 -1
View File
@@ -25,13 +25,14 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS gnb-base FROM ran-base:latest AS gnb-base
FROM ran-build:latest AS gnb-build FROM ran-build:latest AS gnb-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-gnb FROM ${UBUNTU_IMAGE} AS oai-gnb
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
+2 -1
View File
@@ -25,13 +25,14 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS ru-base FROM ran-base:latest AS ru-base
FROM ran-build:latest AS ru-build FROM ran-build:latest AS ru-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-lte-ru FROM ${UBUNTU_IMAGE} AS oai-lte-ru
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
+4 -2
View File
@@ -25,13 +25,15 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS lte-ue-base FROM ran-base:latest AS lte-ue-base
FROM ran-build:latest AS lte-ue-build FROM ran-build:latest AS lte-ue-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-lte-ue FROM ${UBUNTU_IMAGE} AS oai-lte-ue
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
+3 -2
View File
@@ -25,12 +25,13 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS gnb-base FROM ran-base:latest AS gnb-base
FROM ran-build:latest AS gnb-build FROM ran-build:latest AS gnb-build
FROM ubuntu:noble AS oai-nr-cuup FROM ${UBUNTU_IMAGE} AS oai-nr-cuup
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
@@ -46,7 +47,7 @@ RUN apt-get update && \
libyaml-cpp-dev && \ libyaml-cpp-dev && \
# if the --sanitize option was used to build, additional packages are required # if the --sanitize option was used to build, additional packages are required
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
libasan8 \ libasan8 \
libubsan1; fi' && \ libubsan1; fi' && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
+3 -2
View File
@@ -18,13 +18,14 @@
# * For more information about the OpenAirInterface (OAI) Software Alliance: # * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org # * contact@openairinterface.org
# */ # */
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS ran-base FROM ran-base:latest AS ran-base
FROM ran-build-fhi72:latest AS ran-build FROM ran-build-fhi72:latest AS ran-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-nr-oru FROM ${UBUNTU_IMAGE} AS oai-nr-oru
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe ENV TZ=Europe
+2 -1
View File
@@ -25,13 +25,14 @@
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG UBUNTU_IMAGE=ubuntu:noble
FROM ran-base:latest AS nr-ue-base FROM ran-base:latest AS nr-ue-base
FROM ran-build:latest AS nr-ue-build FROM ran-build:latest AS nr-ue-build
#start from scratch for target executable #start from scratch for target executable
FROM ubuntu:noble AS oai-nr-ue FROM ${UBUNTU_IMAGE} AS oai-nr-ue
ARG BUILD_OPTION ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris