forked from oznu/docker-guacamole
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.alpine.pg15
executable file
·129 lines (121 loc) · 6.58 KB
/
Dockerfile.alpine.pg15
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
FROM alpine:edge
ENV CATALINA_HOME=/opt/tomcat \
GUACAMOLE_HOME=/app/guacamole \
PGDATA=/config/postgres \
POSTGRES_USER=guacamole \
POSTGRES_DB=guacamole_db \
POSTGREJDBC_VER=42.7.4 \
S6OVERLAY_VER=3.2.0.2 \
GUAC_DOWN_PATH=https://dlcdn.apache.org/guacamole \
GUAC_VER=1.5.5 \
GUAC_VER_PATH=1.5.5 \
PG_MAJOR=15 \
TOMCAT_VER=9.0.96
RUN set -xe && \
apk update && \
apk upgrade && \
apk add openjdk8-jre \
git \
curl \
libc-dev \
gcc \
make \
automake \
autoconf \
cairo-dev \
libjpeg-turbo-dev \
libpng-dev \
libtool \
libuuid \
ffmpeg4-dev \
freerdp-dev \
pango-dev \
libssh2-dev \
libvncserver-dev \
libwebsockets-dev \
pulseaudio-dev \
openssl-dev \
libvorbis-dev \
libwebp-dev \
postgresql${PG_MAJOR} \
ttf-dejavu \
xmlstarlet \
&& cd /tmp && \
wget --no-check-certificate https://github.com/seanmiddleditch/libtelnet/releases/download/0.23/libtelnet-0.23.tar.gz && \
tar -xzvf libtelnet-0.23.tar.gz && \
cd libtelnet-0.23 && \
./configure && \
make && \
make install && \
cd /tmp && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/s6-overlay-noarch.tar.xz && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/s6-overlay-x86_64.tar.xz && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/s6-overlay-aarch64.tar.xz && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/s6-overlay-armhf.tar.xz && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/s6-overlay-symlinks-noarch.tar.xz && \
wget --no-check-certificate https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VER}/syslogd-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
if [ "$(arch)" = "x86_64" ] ; then tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz; elif [ "$(arch)" = "armhf" ]||[ "$(arch)" = "armv7l" ] ; then tar -C / -Jxpf /tmp/s6-overlay-armhf.tar.xz; else tar -C / -Jxpf /tmp/s6-overlay-aarch64.tar.xz; fi &&\
tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && \
tar -C / -Jxpf /tmp/syslogd-overlay-noarch.tar.xz && \
rm /tmp/*.tar.xz &&\
( ln -s /usr/local/lib/freerdp /usr/lib/arm-linux-gnueabihf/freerdp || \
ln -s /usr/local/lib/freerdp /usr/lib/arm-linux-gnueabi/freerdp || \
ln -s /usr/local/lib/freerdp /usr/lib/x86_64-linux-gnu/freerdp || \
ln -s /usr/local/lib/freerdp /usr/lib/aarch64-linux-gnu/freerdp || \
ln -s /usr/local/lib/freerdp /usr/lib/ppc64el-linux-gnu/freerdp || \
ln -s /usr/local/lib/freerdp /usr/lib/aarch64-linux-gnu/freerdp || true ) &&\
mkdir -p ${CATALINA_HOME} \
${GUACAMOLE_HOME} \
${GUACAMOLE_HOME}/lib \
${GUACAMOLE_HOME}/extensions \
${GUACAMOLE_HOME}/extensions-available \
/git &&\
wget https://dlcdn.apache.org/tomcat/tomcat-9/v$TOMCAT_VER/bin/apache-tomcat-$TOMCAT_VER.tar.gz --no-check-certificate && \
tar xvzf apache-tomcat-$TOMCAT_VER.tar.gz --strip-components 1 --directory /opt/tomcat &&\
cd /git && \
git clone https://github.com/apache/guacamole-server.git --depth=1 -b main && cd guacamole-server -f && autoreconf -fi && \
./configure --enable-allow-freerdp-snapshots --with-init-dir=/etc/init.d &&\
cd /git/guacamole-server && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
ldconfig -v /usr/local/lib &&\
rm -rf ${CATALINA_HOME}/webapps/ROOT &&\
curl -SLo ${CATALINA_HOME}/webapps/ROOT.war "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-${GUAC_VER}.war" && \
curl -SLo ${GUACAMOLE_HOME}/lib/postgresql-${POSTGREJDBC_VER}.jar "https://jdbc.postgresql.org/download/postgresql-${POSTGREJDBC_VER}.jar" &&\
curl -SLO "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" &&\
tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz &&\
cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions/ &&\
cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/schema ${GUACAMOLE_HOME}/ &&\
rm -rf guacamole-auth-jdbc-${GUAC_VER} guacamole-auth-jdbc-${GUAC_VER}.tar.gz &&\
for i in auth-duo auth-quickconnect auth-header auth-ldap auth-json auth-totp history-recording-storage; do \
echo "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" &&\
curl -SLO "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" &&\
tar -xzf guacamole-${i}-${GUAC_VER}.tar.gz &&\
cp guacamole-${i}-${GUAC_VER}/guacamole-${i}-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ &&\
rm -rf guacamole-${i}-${GUAC_VER} guacamole-${i}-${GUAC_VER}.tar.gz \
;done &&\
curl -SLO "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-auth-sso-${GUAC_VER}.tar.gz" &&\
tar -xzf guacamole-auth-sso-${GUAC_VER}.tar.gz &&\
for i in cas openid saml; do \
cp guacamole-auth-sso-${GUAC_VER}/${i}/guacamole-auth-sso-${i}-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
;done &&\
rm -rf guacamole-auth-sso-${GUAC_VER} guacamole-auth-sso-${GUAC_VER}.tar.gz \
# Special case for Vault extension. Currently supports only ksm, but it seems there are plans for future providers
# I keep the for loop, just in case future releases of guacamole bundles other extensions...
&& curl -SLO "${GUAC_DOWN_PATH}/${GUAC_VER_PATH}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \
&& tar -xzf guacamole-vault-${GUAC_VER}.tar.gz \
&& for i in ksm; do \
cp guacamole-vault-${GUAC_VER}/${i}/guacamole-vault-${i}-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
;done \
&& rm -rf guacamole-vault-${GUAC_VER} guacamole-vault-${GUAC_VER}.tar.gz
COPY root /
COPY root_alpine_pg15 /
ENV PATH=/usr/lib/postgresql/${PG_MAJOR}/bin:$PATH \
GUACAMOLE_HOME=/config/guacamole \
GUACD_LOG_LEVEL=info \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
WORKDIR /config
EXPOSE 8080
ENTRYPOINT [ "/init" ]
HEALTHCHECK --timeout=3s CMD wget --no-verbose --tries=1 --spider http://localhost:8080 || exit 1