1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-14 11:23:34 +02:00
dockerfiles/freeradius/Dockerfile
2016-07-28 18:44:12 +08:00

32 lines
996 B
Docker

#
# Dockerfile for freeradius
#
FROM alpine
MAINTAINER kev <noreply@easypi.info>
RUN set -xe \
&& apk add --no-cache freeradius \
freeradius-mysql \
freeradius-radclient \
make \
openssl \
&& /etc/raddb/certs/bootstrap \
&& chown -R root:radius /etc/raddb/certs \
&& ln -s /etc/raddb/mods-available/sql \
/etc/raddb/mods-available/sqlcounter /etc/raddb/mods-enabled \
&& sed -i -e 's@driver =.*@driver = "rlm_sql_mysql"@' \
-e 's@dialect =.*@dialect = "mysql"@' \
-e '/read_clients = yes/s@^#@@' \
-e '/Connection info:/,/^$/{s@^#@@;s@localhost@mysql@}' \
/etc/raddb/mods-available/sql \
&& sed -i -e '/^#\t*eap$/s@^#@@' \
-e '/^#\teap {$/,/#\t}$/s@^#@@' \
/etc/raddb/sites-enabled/default
VOLUME /etc/raddb
EXPOSE 1812/udp 1813/udp
CMD ["radiusd", "-fl", "stdout"]