-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (53 loc) · 2.24 KB
/
Dockerfile
File metadata and controls
70 lines (53 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Download base image ubuntu 22.04
FROM ubuntu:24.04
LABEL org.opencontainers.image.source="https://github.com/ict-solutions-dev/docker-duoauthproxy" \
org.opencontainers.image.description="Docker image for Duo Security Authentication Proxy with RADIUS support." \
org.opencontainers.image.title="Security Authentication Proxy" \
org.opencontainers.image.authors="Jozef Rebjak <jozef.rebjak@ictsolutions.net>" \
org.opencontainers.image.vendor="ICT Solutions"
# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
# Update Ubuntu Software repository and install dependencies
# hadolint ignore=DL3008
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
libssl-dev \
build-essential \
libffi-dev \
perl \
zlib1g-dev \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Add default user (with UID 35505 and GID 35505)
RUN groupadd -r duo -g 35505 && useradd --no-log-init -r -g duo -u 35505 duo
# Specify DuoAuthProxy version
ARG DUO_VERSION
# Install duoauthproxy itself
WORKDIR /tmp
RUN wget --progress=dot:giga --no-check-certificate -O duoauthproxy-${DUO_VERSION}-src.tgz https://dl.duosecurity.com/duoauthproxy-${DUO_VERSION}-src.tgz && \
tar -zxf duoauthproxy-${DUO_VERSION}-src.tgz && \
rm duo*.tgz && \
mv duoauthproxy-*-src duoauthproxy-src
WORKDIR /tmp/duoauthproxy-src
# Optional: enable DNS hostname support for [radius_client] host parameter
ARG ENABLE_DNS_PATCH=false
COPY assets/patch-dns-support.sh /tmp/patch-dns-support.sh
RUN if [ "$ENABLE_DNS_PATCH" = "true" ]; then \
sh /tmp/patch-dns-support.sh /tmp/duoauthproxy-src; \
fi && rm /tmp/patch-dns-support.sh
RUN make
WORKDIR /tmp/duoauthproxy-src/duoauthproxy-build
RUN ./install --install-dir /opt/duoauthproxy --service-user duo --log-group duo --create-init-script no --enable-selinux no
# Clean up
RUN rm -rf /tmp/duoauthproxy-src && \
apt-get clean
# Expose Ports for the Application
EXPOSE 1812-1818/udp 18120/udp 636/tcp 389/tcp
# Volume configuration
VOLUME ["/opt/duoauthproxy/conf/","/opt/duoauthproxy/log/"]
# Copy init script and make it executable
COPY assets/01-init.sh /
RUN chmod +x /01-init.sh
USER duo:duo
ENTRYPOINT ["/01-init.sh"]