Avoid x86-specific Dockerfiles/enable ARM

Dockerfiles hardcoded one copy operation to x86; generalize to capture
ARM as well. Since the target directory cannot have any globs, we need
to manually check the right directory, then move the file.

Note that this is only necessary since we are forced to switch the
compiler, as Ubuntu's default gcc-11 does not work with FlexRIC. When
upgrading to Ubuntu 24, these lines should disappear and asan be
installed as normal. See commit 94497435e7 ("Upgrade CI images to
Ubuntu 22").
This commit is contained in:
Robert Schmidt
2025-03-24 09:18:44 +01:00
parent 8cbfa7b797
commit 677a904b6c
3 changed files with 36 additions and 3 deletions
+12 -1
View File
@@ -77,7 +77,18 @@ RUN apt-get update && \
# library version. Installing it above would install the wrong version. Hence,
# copy the right version from ran-build. When upgrading to Ubuntu24, install
# the correct one above!
COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/
# note: this dockerfile should work for both x86 and arm, hence the glob below
# which should either match "x86_64" (x86) or "aarch64" (ARM); since the target
# directory needs to be also one of those two, but globs don't work in target
# directories, work around this with mv
COPY --from=gnb-build /usr/lib/*-linux-gnu/libasan.so.8.0.0 /usr/lib/
ARG TARGETPLATFORM
RUN case "${TARGETPLATFORM}" in \
"linux/amd64") TARGET_DIR=x86_64-linux-gnu ;; \
"linux/arm64") TARGET_DIR=aarch64-linux-gnu ;; \
*) exit 1 ;; \
esac; \
mv /usr/lib/libasan.so.8.0.0 /usr/lib/$TARGET_DIR/libasan.so.8.0.0
WORKDIR /opt/oai-gnb/bin
COPY --from=gnb-build \
+12 -1
View File
@@ -54,7 +54,18 @@ RUN apt-get update && \
# library version. Installing it above would install the wrong version. Hence,
# copy the right version from ran-build. When upgrading to Ubuntu24, install
# the correct one above!
COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/
# note: this dockerfile should work for both x86 and arm, hence the glob below
# which should either match "x86_64" (x86) or "aarch64" (ARM); since the target
# directory needs to be also one of those two, but globs don't work in target
# directories, work around this with mv
COPY --from=gnb-build /usr/lib/*-linux-gnu/libasan.so.8.0.0 /usr/lib/
ARG TARGETPLATFORM
RUN case "${TARGETPLATFORM}" in \
"linux/amd64") TARGET_DIR=x86_64-linux-gnu ;; \
"linux/arm64") TARGET_DIR=aarch64-linux-gnu ;; \
*) exit 1 ;; \
esac; \
mv /usr/lib/libasan.so.8.0.0 /usr/lib/$TARGET_DIR/libasan.so.8.0.0
## Copy E2 SM models
COPY --from=gnb-build /usr/local/lib/flexric /usr/local/lib/flexric
+12 -1
View File
@@ -77,7 +77,18 @@ RUN apt-get update && \
# library version. Installing it above would install the wrong version. Hence,
# copy the right version from ran-build. When upgrading to Ubuntu24, install
# the correct one above!
COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/
# note: this dockerfile should work for both x86 and arm, hence the glob below
# which should either match "x86_64" (x86) or "aarch64" (ARM); since the target
# directory needs to be also one of those two, but globs don't work in target
# directories, work around this with mv
COPY --from=nr-ue-build /usr/lib/*-linux-gnu/libasan.so.8.0.0 /usr/lib/
ARG TARGETPLATFORM
RUN case "${TARGETPLATFORM}" in \
"linux/amd64") TARGET_DIR=x86_64-linux-gnu ;; \
"linux/arm64") TARGET_DIR=aarch64-linux-gnu ;; \
*) exit 1 ;; \
esac; \
mv /usr/lib/libasan.so.8.0.0 /usr/lib/$TARGET_DIR/libasan.so.8.0.0
WORKDIR /opt/oai-nr-ue/bin
COPY --from=nr-ue-build \