1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00

add freeradius

This commit is contained in:
kev 2016-07-27 14:55:05 +08:00
parent 9e46fd4d47
commit 5dd6960b32

33
freeradius/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
#
# Dockerfile for freeradius
#
FROM alpine
MAINTAINER kev <noreply@easypi.info>
RUN set -xe \
&& apk add --no-cache freeradius \
freeradius-radclient \
freeradius-sqlite \
sqlite \
&& ln -s /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/sql \
&& sed -i -e 's@driver =.*@driver = "rlm_sql_sqlite"@' \
-e 's@dialect =.*@dialect = "sqlite"@' \
-e '/sqlite {$/,/}$/{s@^#@@;s@/tmp@/etc/raddb@}' \
/etc/raddb/mods-available/sql
RUN set -xe \
&& cd /etc/raddb \
&& sqlite3 freeradius.db < /etc/raddb/mods-config/sql/main/sqlite/schema.sql \
&& echo "INSERT INTO radcheck VALUES('0','user','Cleartext-Password',':=','pass');" | sqlite3 freeradius.db \
&& radiusd \
&& radtest user pass localhost 0 testing123 \
&& echo "DELETE FROM radcheck WHERE id='0';" | sqlite3 freeradius.db
VOLUME /etc/raddb
EXPOSE 1812/udp \
1813/udp \
47132/udp
CMD ["radiusd", "-f"]