1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-12 11:15:04 +02:00
dockerfiles/freeradius/Dockerfile

32 lines
996 B
Docker
Raw Normal View History

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