Sign inSign up

losenmann/dante

By losenmann

•Updated 2 months ago

Image
0

7.3K

losenmann/dante repository overview

Dockerfile

FROM alpine:3.22.2 AS builder-dante
ARG VERSION
ENV CPPFLAGS="-I/usr/include/tirpc -D_GNU_SOURCE -I/usr/include/security -Wno-discarded-qualifiers -Wno-attributes"
ENV LDFLAGS="-ltirpc"
ENV ac_cv_func_bindresvport=yes
ENV ac_cv_func_sched_setscheduler=no
ENV ac_cv_func_sched_getscheduler=no
WORKDIR /tmp/src
ADD --unpack=true https://www.inet.no/dante/files/dante-${VERSION}.tar.gz .
RUN apk add --no-cache \
        build-base \
        make \
        linux-pam \
        musl-dev \
        linux-pam-dev \
        freeradius-pam \
        libtirpc-dev \
        libtirpc
WORKDIR ./dante-${VERSION}
RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-pam
RUN make -j$(nproc)
WORKDIR ../../out-stage
RUN install -m 755 ../src/dante-${VERSION}/sockd/sockd -D ./usr/bin/sockd \
    && install -m 644 ../src/dante-${VERSION}/example/sockd.conf -D ./etc/sockd.conf

FROM alpine:3.23.4 AS builder-pam_radius
WORKDIR /tmp/src
ADD https://github.com/FreeRADIUS/pam_radius.git#release_3_0_0 .
ADD https://cgit.git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=a2287c3041a3f2a204eb942e09c015eab00dc7dd .
ADD https://cgit.git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=a2287c3041a3f2a204eb942e09c015eab00dc7dd .
RUN apk add --no-cache \
        build-base \
        linux-pam-dev \
        make
RUN ./configure
RUN make -j$(nproc)
WORKDIR ../out-stage
RUN install -m 755 ../src/pam_radius_auth.so -D ./usr/lib/security/pam_radius_auth.so \
    && install -m 644 ../src/pam_radius_auth.conf -D ./etc/pam_radius_auth.conf

FROM alpine:3.23.4 AS merge
WORKDIR /tmp/out-stage
COPY --from=builder-pam_radius /tmp/out-stage ./
COPY --from=builder-dante /tmp/out-stage ./
WORKDIR ./etc/pam.d
RUN cat <<-EOF > ./sockd
        auth       required   pam_radius_auth.so
        account    required   pam_permit.so
EOF
WORKDIR ../../var/log/sockd
RUN chown -R 1000:1000 .

FROM alpine:3.23.4 AS app
RUN apk add --no-cache libtirpc linux-pam
COPY --from=merge /tmp/out-stage /
EXPOSE 1080/tcp
ENTRYPOINT ["sockd"]
CMD ["-f", "/etc/sockd.conf"]

Tag summary

Content type

Image

Digest

sha256:caad1d6be…

Size

8.2 MB

Last updated

2 months ago

docker pull losenmann/dante