Skip to content

paulscalise1/free5gc-compose

 
 

Repository files navigation

free5GC compose

This repository is a docker compose version of free5GC for stage 3. It's inspired by free5gc-docker-compose and also reference to docker-free5gc.

You can setup your own config in config folder and docker-compose.yaml

Prerequisites

Note: AVX for MongoDB: some HW does not support MongoDB releases above4.4 due to use of the new AVX instructions set. To verify if your CPU is compatible you can check CPU flags by running grep avx /proc/cpuinfo. A workaround is suggested here.

Start free5gc

Because we need to create tunnel interface, we need to use privileged container with root permission.

Pull docker images from Docker Hub

docker compose pull

[Optional] Build docker images from local sources

# Clone the project
git clone https://github.com/free5gc/free5gc-compose.git
cd free5gc-compose

# clone free5gc sources
cd base
git clone --recursive -j `nproc` https://github.com/free5gc/free5gc.git
cd ..

# Build the images
make all
docker compose -f docker-compose-build.yaml build

# Alternatively you can build specific NF image e.g.:
make amf
docker compose -f docker-compose-build.yaml build free5gc-amf

Note:

Dangling images may be created during the build process. It is advised to remove them from time to time to free up disk space.

docker rmi $(docker images -f "dangling=true" -q)

Run free5GC

You can create free5GC containers based on local images or docker hub images:

# use local images
docker compose -f docker-compose-build.yaml up
# use images from docker hub
docker compose up # add -d to run in background mode

Destroy the established container resource after testing:

# Remove established containers (local images)
docker compose -f docker-compose-build.yaml rm
# Remove established containers (remote images)
docker compose rm

Troubleshooting

Sometimes, you need to drop data from DB:

docker exec -it mongodb mongosh
> use free5gc
> db.dropDatabase()
> exit # (Or Ctrl-D)

You can see logs for each service using docker logs command. For example, to access the logs of the SMF you can use:

docker logs smf

Please refer to the wiki for more troubleshooting information.

Integration with (external) gNB/UE

UERANSIM Notes

The integration with the UERANSIM eNB/UE simulator is documented here.

This issue provides detailed steps that might be useful.

Option 1: Run UE inside gNB container

You can launch a UE using:

docker exec -it ueransim bash
root@host:/ueransim# ./nr-ue -c config/uecfg.yaml

Option 2: Run UE on a separate container

By default, the provided UERANSIM service on this docker-compose.yaml will only act as a gNB. If you want to create a UE you'll need to:

  1. Create a subscriber through the WebUI. Follow the steps here
  2. Copy the UE ID field
  3. Change the value of supi in config/uecfg.yaml to the UE ID that you just copied
  4. Change the linkIp in config/gnbcfg.yaml to gnb.free5gc.org (which is also present in the gnbSearchList in config/uecfg.yaml) to enable communication between the UE and gNB services
  5. Add an UE service on docker-compose.yaml as it follows:
  ue:
    container_name: ue
    image: free5gc/ueransim:latest
    command: ./nr-ue -c ./config/uecfg.yaml
    volumes:
      - ./config/uecfg.yaml:/ueransim/config/uecfg.yaml
    cap_add:
      - NET_ADMIN
    devices:
      - "/dev/net/tun"
    networks:
      privnet:
        aliases:
          - ue.free5gc.org
    depends_on:
      - ueransim
  1. Run docker-compose.yaml

srsRAN Notes

You can check this issue for some sample configuration files of srsRAN + free5GC

Integration of WebUI with Nginx reverse proxy

Here you can find helpful guidelines on the integration of Nginx reverse proxy to set it in front of the WebUI: free5gc#55 (comment)

ULCL Configuration

To start the core with a i-UPF and two PSA UPFs ULCL configuration, use

docker compose -f docker-compose-ulcl.yaml up

Note: This configuration have been tested using release free5gc-compose v3.4.1

Check out the used configuration files at config/ULCL.

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 73.6%
  • Makefile 12.6%
  • Shell 9.3%
  • Nextflow 4.5%