Docker Community Forums

Share and learn in the Docker community.

Need help about asdaru/freeradius-mysql-daloradius Docker

Hello,

I use asdaru/freeradius-mysql-daloradius ffrom here: Docker Hub

I can’t lunch it with author parameter:
Start freeradius container:

docker run --name freeradius -d -p 1812:1812/udp -p 1813:1813/udp -p 80:80 -e CLIENT_SECRET=<Radius secret> -e CLIENT_NET=<client net> RADIUS_DB_SERVER=<MYSQL SERVER> -e RADIUS_DB_USER=<MYSQL USER> -e RADIUS_DB_PWD=<MYSQL PASSWD> asdaru/freeradius-mysql-daloradius

Please Help.

Please tells us about the error you get, or whatever is telling you things do not work?

Also, you did replace things like <Radius secret> with some actual values that apply to your situation, and have some MySQL database running like documented?

For mysql database you can use docker to[o]

docker run --name db -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest

docker run --name freeradius -d -p 1812:1812/udp -p 1813:1813/udp -p 80:80 -e CLIENT_SECRET=<Radius secret> -e CLIENT_NET=<client net> --link db:db RADIUS_DB_SERVER=db -e RADIUS_DB_USER=root> -e RADIUS_DB_PWD=my-secret-pw  asdaru/freeradius-mysql-daloradius:nomysql

Hard to tell from your image, but you’re at least missing an -e before RADIUS_DB_SERVER=db (which is indeed also missing in the documentation), making Docker think RADIUS_DB_SERVER is some repository name rather than a parameter.

The documentation also shows an excessive > after -e RADIUS_DB_USER=root>. And you may want to read the documentation for CLIENT_NET, as a random number like your 87654321 will not suffice:

CLIENT_NET

Netwok where your NAS devices were installed (for example 192.168.0.0/16) By default was set unlimited access 0.0.0.0/0

(Please don’t use images for text. Thanks.)

Tank a lot for your help.
Here is my command line:
docker run --name freeradius -d -p 1812:1812/udp -p 1813:1813/udp -p 80:80 -e CLIENT_SECRET=12345678 -e CLIENT_NET=0.0.0.0/0 --link db:db -e RADIUS_DB_SERVER=db -e RADIUS_DB_USER=root -e RADIUS_DB_PWD=my-secret-pw asdaru/freeradius-mysql-daloradius:nomysql

I have another error:
Status: Downloaded newer image for asdaru/freeradius-mysql-daloradius:nomysql
78a7e1d0df82c002f7fc953be2657665b1e188474726549d7e10119abc83a554
docker: Error response from daemon: Cannot link to a non running container: /db AS /freeradius/db.

I’d say that this time you did not start MySQL (using docker run --name db -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest) before starting the second container?

However, my bad, looking at the Docker Hub documentation a bit better, it seems there are two options: one with a built-in MySQL (asdaru/freeradius-mysql-daloradius) and another for use with your own MySQL (asdaru/freeradius-mysql-daloradius:nomysql; note the additional :nomysql suffix).

Knowing that now, I don’t understand why, according to the Docker Hub documentation, the first one still needs the parts -e RADIUS_DB_SERVER=<MYSQL SERVER> -e RADIUS_DB_USER=<MYSQL USER> -e RADIUS_DB_PWD=<MYSQL PASSWD>. (Aside, note that the first example is missing the -e as well.)

Next, looking at the Dockerfile in the nomysql branch in GitHub it seems those parameters are used indeed, when using one’s own MySQL:

ENV RADIUS_DB_SERVER ""
ENV RADIUS_DB_SERVER_PORT "3306"
ENV RADIUS_DB_NAME "radius"
ENV RADIUS_DB_USER "radius"
ENV RADIUS_DB_PWD "radpass"
ENV CLIENT_NET "0.0.0.0/0"
ENV CLIENT_SECRET testing123

But the GitHub master branch for the embedded MySQL version does not need those:

ENV RADIUS_DB_PWD radpass
ENV CLIENT_NET "0.0.0.0/0"
ENV CLIENT_SECRET testing123

This is confirmed in its init.sh script. Even better: the README for that version shows an example that makes more sense:

docker run --name freeradius -d -p 1812:1812/udp -p 1813:1813/udp -p 80:80 -e CLIENT_SECRET=<Radius secret> -e CLIENT_NET=<client net>  asdaru/freeradius-mysql-daloradius

So, I’d forget about your own MySQL container and try the above. (This uses a default MySQL user radius with password radpass.)