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
- GTP5G kernel module: needed to run the UPF (Currently, UPF only supports GTP5G versions 0.9.5 (use git clone --branch v0.9.5 --depth 1 https://github.com/free5gc/gtp5g.git).)
- Docker Engine: needed to run the Free5GC containers
- Docker Compose v2: needed to bootstrap the free5GC stack
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.
Because we need to create tunnel interface, we need to use privileged container with root permission.
docker compose pull# 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-amfNote:
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)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 modeDestroy 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 rmPlease refer to the Troubleshooting for more troubleshooting information.
The integration with the UERANSIM eNB/UE simulator is documented here.
This issue provides detailed steps that might be useful.
You can launch a UE using:
docker exec -it ueransim bash
root@host:/ueransim# ./nr-ue -c config/uecfg.yamlBy 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:
- Create a subscriber through the WebUI. Follow the steps here
- Copy the
UE IDfield - Change the value of
supiinconfig/uecfg.yamlto the UE ID that you just copied - Change the
linkIpinconfig/gnbcfg.yamltognb.free5gc.org(which is also present in thegnbSearchListinconfig/uecfg.yaml) to enable communication between the UE and gNB services - Add an UE service on
docker-compose.yamlas 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- Run
docker-compose.yaml
You can check this issue for some sample configuration files of srsRAN + free5GC
Here you can find helpful guidelines on the integration of Nginx reverse proxy to set it in front of the WebUI: free5gc#55 (comment)
To start the core with a I-UPF and PSA-UPF ULCL configuration, use
docker compose -f docker-compose-ulcl.yaml upNote: This configuration have been tested using release free5gc-compose v4.0.0
Check out the used configuration files at config/ULCL.
To start the core with Prometheous and Grafana, we need external compose service file to start with our core compose:
docker compose -f docker-compose.yaml -f docker-compose-prometheus.yaml upPlease make sure the metrics secions are enabled in NFs' config, it is disabled in default:
# Metrics configuration
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
metrics:
=> enable: true # (Optional, default false)
scheme: http # (Required) the protocol for metrics (http or https, default https)
bindingIPv4: amf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
port: 9091 # (Optional, default 9091) port used to bind the service
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
pem: cert/amf.pem # AMF TLS Certificate
key: cert/amf.key # AMF TLS Private key
namespace: free5gc # (Optional, default free5gc)