Use bazel-base image as basis for Bazel builds in Dockerfiles
E.g. in lte/gateway/docker/services/c/Dockerfile a new Docker image is built from Focal, in which a Bazel build happens. Having many different Docker files is hard to maintain. If all Bazel builds are based on the bazel-base Docker image then the same conditions and system dependencies are used for all builds. It may also speed up the workflows.
I.e. in lte/gateway/docker/services/c/Dockerfile, instead of doing
FROM $OS_DIST:$OS_RELEASE AS builder
...
...
# Setup necessary tools for adding the Magma repository
apt-get install -y apt-utils software-properties-common apt-transport-https gnupg wget && \
# Download Bazel
wget -P /usr/sbin --progress=dot:giga https://github.com/bazelbuild/bazelisk/releases/download/v1.10.0/bazelisk-linux-"${DEB_PORT}" && \
chmod +x /usr/sbin/bazelisk-linux-"${DEB_PORT}" && \
ln -s /usr/sbin/bazelisk-linux-"${DEB_PORT}" /usr/sbin/bazel
# Install dependencies required for building
...
simply do
FROM ghcr.io/magma/magma/bazel-base:latest AS builder
...
bazel build ...
Use bazel-base image as basis for Bazel builds in Dockerfiles
E.g. in
lte/gateway/docker/services/c/Dockerfile
a new Docker image is built from Focal, in which a Bazel build happens. Having many different Docker files is hard to maintain. If all Bazel builds are based on the bazel-base Docker image then the same conditions and system dependencies are used for all builds. It may also speed up the workflows.I.e. in
lte/gateway/docker/services/c/Dockerfile
, instead of doingsimply do