Borjis131 / docker-open5gs

Open5GS 5G Core Docker images and Docker compose deployments
GNU Affero General Public License v3.0
29 stars 15 forks source link
5g 5g-core 5g-core-network 5g-networks 5g-sa docker docker-compose kubernetes open5gs

Open5GS 5G Core in Docker

Open5GS 5G Core Network Functions images ready for Docker.

This repository contains the Dockerfiles, Docker Compose files and Helm charts to deploy a configurable 5G Core.

The repository uses the same release version tags as Open5GS, so to use an specific Open5GS version just select the appropiate tag.

The Docker images are available for amd64/x86-64 and arm64/v8:

The Helm charts are available:

[!NOTE] The is not the same as the

Configure it

All the images (except webui) depend on the base-open5gs image to be built, after that each image is independent.

First, update the .env and docker-bake.hcl files with the desired values to use.

The .env file is used to build the images using Make or Docker Compose, as well as deploying in Docker Compose. The docker-bake.hcl file is used to build the images using bake.

OPEN5GS_VERSION is the version of Open5GS to use.

UBUNTU_VERSION is the version of the ubuntu Docker image used as base for the containers.

MONGODB_VERSION is the version of the mongo Docker image used as database for Open5GS.

NODE_VERSION is the version of Node.js being used to build the Open5GS WebUI.

DOCKER_HOST_IP is the IP address of the host running Docker. This modifies the advertise field in the upf.yaml config file for this to work when exposing the Docker containers network.

Build it

Build it with Bake > Tip: This is the recommended way to build the project, you can build the images all at once with a single command taking advantage of docker buildx parallelism > Note: This method uses the `docker-bake.hcl` file and requires `docker-buildx-plugin` From the top level directory of the repository run: ```bash docker buildx bake ```
Build it with Make > Note: This method uses the `Makefile` and `.env` files From the top level directory of the repository run the following to create the `base-open5gs` image and all the Network Function images: ```bash make all ``` This will take a while.
Build it with Docker Compose > Note: This method uses the `Makefile`, `.env` and `docker-compose.yaml` files Some deployments have the build instructions for the images (like the `basic` deployment), only depending of the `base-open5gs` image. Some other deployments download the images needed from container registries like Docker Hub or GitHub Container Registry (like the `network-slicing` deployment). First create the `base-open5gs` image, from the top level directory of the repository run: ```bash make base-open5gs ``` Then select the appropiate deployment (`basic`, `scp-model-d` or `roaming`). From the top level directory of the repository, run: ```bash # Example using the basic deployment docker compose -f compose-files/basic/docker-compose.yaml --env-file=.env up -d ``` This command builds all the images for the deployment selected and then runs the deployment.
Build the Helm charts Use the following commands inside the `helm/` directory. First retrieve the dependencies of each chart individually, the `open5gs` chart must be the latest one, cause it depends on all the other charts: ```bash helm dependency build ./ ``` You can also package the charts (it is not mandatory): ```bash helm package ./ ```

Use it

Use it with Docker Compose Update the `.env` file with the desired values to use: Then select the appropiate deployment and from the top level directory of the repository run: ```bash # Run the basic deployment docker compose -f compose-files/basic/docker-compose.yaml --env-file=.env up -d # Tear down the basic deployment docker compose -f compose-files/basic/docker-compose.yaml --env-file=.env down ```
Use it with Kubernetes You can download the packaged charts from the repository or you can use the ones built by yourself. Current `CHART_VERSION` value for the Open5GS chart is 0.3.1, using `OPEN5GS_VERSION` v2.7.2 as default. The `CHART_VERSION` for individual charts is 0.3.0, using `OPEN5GS_VERSION` v2.7.2 as default. To download a chart: ```bash helm pull oci://registry-1.docker.io/borieher/ --version ``` To install a chart run: ```bash helm install -n ./ ``` You can provide your custom values using the helm flag `-f` and providing a `values.yaml` file: ```bash helm install -n -f values.yaml ./ ``` If the namespace does not exist, create it by using the helm flag `--create-namespace`. To uninstall a chart and remove a namespace run: ```bash helm uninstall -n kubectl delete namespace ```

Repository structure

Overview of the basic deployment

Overview of the basic deployment

The basic deployment is prepared to work with external gNBs, exposing:

It also exposes the MongoDB database using TCP port 27017.

Check docs/ to see the full documentation for the different deployments.