This is an old revision of the document!
RADIUSdesk Docker Image
Introduction
- You need to know the basics of Docker to be able to execute these instructions.
- The Docker image will create a split image (two containers)
- One container will be the database with MariaDB
- The other container is the web server with Nginx, PHP and FreeRADIUS.
Install Docker
- We assume that you are a user named system on a standard Ubuntu 26.04 installation.
- Set up the Docker repository:
# Add Docker's official GPG key: sudo apt update sudo apt install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: sudo tee /etc/apt/sources.list.d/docker.sources <<EOF Types: deb URIs: https://download.docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/apt/keyrings/docker.asc EOF sudo apt update
- Install the Docker packages:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Manage Docker as a non-root user:
USER="system" sudo usermod -aG docker $USER
- After running this, you must log out and log back in (or run newgrp docker) for the group changes to take effect.
- Verify the install
docker --version docker compose version docker run hello-world #---- This was the output --- Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 4f55086f7dd0: Pull complete d5e71e642bf5: Download complete Digest: sha256:5e23090353324d887c48ad5e5c56d294eab81588df9605b07d1afe895f9cc8f8 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
Starting with a clean slate
- You might have some existing docker containers and images that you first want to get rid of.
- Use these instructions with caution. It might destroy items you do not want to destroy.
#Only run these commands if you want to start with a full clean slate docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) docker network rm radiusdesk-bridge
Create the Docker containers
- Everything you need to create the RADIUSdesk Docker containers are provided by the rdcore and rd_cake5 repositories.
- Check out the rdcore git repository.
cd ~ sudo git clone https://github.com/RADIUSdesk/rdcore.git
- Check out the rd_cake5 git repository.
cd ~ sudo git clone https://github.com/RADIUSdesk/rd_cake5.git
- Mount the rdcore top directory to the rdcore/docker/rdcore directory
cd rdcore/docker sudo mkdir rdcore sudo mount --bind ../../rdcore ./rdcore
- Mount the rd_cake5 directory to the rdcore/docker/rd_cake5 directory
sudo mkdir rd_cake5 sudo mount --bind ../../rd_cake5 ./rd_cake5
- Execute the script local_build.sh.
./local_build.sh
- There will be feedback on the screen as the two docker containers getting built.
- On my one Ubuntu machine I got an error message about
docker-credential-desktop not installed or not available in PATH
- The cure was to edit ~/.docker/config.json and replace “credsStore” by “credStore”.
{ "auths": {}, "credStore": "desktop", "currentContext": "default" }
- After the process is complete, you can confirm that it is running
docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 98339a6a1b57 docker_radiusdesk "/bin/sh -c '/usr/bi…" About an hour ago Up About an hour 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:1812-1813->1812-1813/udp, :::1812-1813->1812-1813/udp, 9000/tcp radiusdesk db3c6fa81d8b bitnami/mariadb:10.5 "/opt/bitnami/script…" 2 hours ago Up 2 hours 3306/t
- Open a browser and call up the IP address of the host on which the Docker containers are running.
Working with the Docker containers
- The docker containers can be seen as a lightweight Linux machine.
- To see which dockers are running:
docker ps #This was the reply on my machine CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5c99a3eb667b docker-radiusdesk "/bin/sh -c '/usr/bi…" About an hour ago Up 39 minutes 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:1812-1813->1812-1813/udp, [::]:1812-1813->1812-1813/udp radiusdesk 881209d31244 mariadb:11.8 "docker-entrypoint.s…" About an hour ago Up 39 minutes 3306/tcp radiusdesk-mariadb
- You can shell into the radiusdesk container with the following command:
docker exec -it radiusdesk bash
- To make a backup of the DB you can issue:
mysqldump -h radiusdesk-mariadb -u rd -p --events rd > /tmp/rd.sql
- There are also a vi editor and the ping command installed for basic editing and network troubleshooting.
- To exit out of the docker container simply type exit.
- You can shell into the radiusdesk-mariadb container with the following command:
docker exec -it radiusdesk-mariadb bash