Commit 677a904b authored by Robert Schmidt's avatar Robert Schmidt

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 94497435 ("Upgrade CI images to
Ubuntu 22").
parent 8cbfa7b7
......@@ -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 \
......
......@@ -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
......
......@@ -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 \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment