mirror of
https://github.com/jwetzell/docker-guacamole.git
synced 2026-08-20 22:49:19 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cabf2a5eca |
+2
-20
@@ -3,11 +3,7 @@ FROM library/tomcat:9-jre11-openjdk-bullseye
|
|||||||
ENV ARCH=amd64 \
|
ENV ARCH=amd64 \
|
||||||
GUAC_VER=1.5.4 \
|
GUAC_VER=1.5.4 \
|
||||||
GUACAMOLE_HOME=/app/guacamole \
|
GUACAMOLE_HOME=/app/guacamole \
|
||||||
PG_VER=9.6.24 \
|
LIBSSH2_VER=1.11.0
|
||||||
LIBSSH2_VER=1.11.0 \
|
|
||||||
PGDATA=/config/postgres \
|
|
||||||
POSTGRES_USER=guacamole \
|
|
||||||
POSTGRES_DB=guacamole_db
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -29,17 +25,6 @@ RUN tar -xzvf /tmp/libssh2-${LIBSSH2_VER}.tar.gz \
|
|||||||
&& make install \
|
&& make install \
|
||||||
&& rm -rf /tmp/libssh2-${LIBSSH2_VER}*
|
&& rm -rf /tmp/libssh2-${LIBSSH2_VER}*
|
||||||
|
|
||||||
# Build & install postgresql
|
|
||||||
ADD https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz /tmp
|
|
||||||
RUN tar -xzvf /tmp/postgresql-${PG_VER}.tar.gz \
|
|
||||||
&& cd postgresql-${PG_VER} \
|
|
||||||
&& ./configure \
|
|
||||||
&& make \
|
|
||||||
&& make install \
|
|
||||||
&& rm -rf /tmp/postgresql-${PG_VER}*
|
|
||||||
|
|
||||||
RUN useradd postgres
|
|
||||||
|
|
||||||
# Apply the s6-overlay
|
# Apply the s6-overlay
|
||||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-amd64.tar.gz /tmp
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-amd64.tar.gz /tmp
|
||||||
RUN tar -xzf /tmp/s6-overlay-amd64.tar.gz -C / \
|
RUN tar -xzf /tmp/s6-overlay-amd64.tar.gz -C / \
|
||||||
@@ -71,18 +56,15 @@ RUN curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/source/guac
|
|||||||
# Create directory for extensions
|
# Create directory for extensions
|
||||||
RUN mkdir ${GUACAMOLE_HOME}/extensions-available
|
RUN mkdir ${GUACAMOLE_HOME}/extensions-available
|
||||||
|
|
||||||
# Install guacamole-client and postgres auth adapter
|
# Install guacamole-client
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& rm -rf ${CATALINA_HOME}/webapps/ROOT \
|
&& rm -rf ${CATALINA_HOME}/webapps/ROOT \
|
||||||
&& curl -SLo ${CATALINA_HOME}/webapps/ROOT.war "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${GUAC_VER}.war" \
|
&& curl -SLo ${CATALINA_HOME}/webapps/ROOT.war "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${GUAC_VER}.war" \
|
||||||
&& curl -SLo ${GUACAMOLE_HOME}/lib/postgresql-42.1.4.jar "https://jdbc.postgresql.org/download/postgresql-42.2.24.jar" \
|
|
||||||
&& curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" \
|
&& curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" \
|
||||||
&& tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz \
|
&& tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz \
|
||||||
&& cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions/ \
|
|
||||||
&& cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
&& cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
||||||
&& cp guacamole-auth-jdbc-${GUAC_VER}/mysql/guacamole-auth-jdbc-mysql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
&& cp guacamole-auth-jdbc-${GUAC_VER}/mysql/guacamole-auth-jdbc-mysql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
||||||
&& cp guacamole-auth-jdbc-${GUAC_VER}/sqlserver/guacamole-auth-jdbc-sqlserver-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
&& cp guacamole-auth-jdbc-${GUAC_VER}/sqlserver/guacamole-auth-jdbc-sqlserver-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \
|
||||||
&& 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
|
&& rm -rf guacamole-auth-jdbc-${GUAC_VER} guacamole-auth-jdbc-${GUAC_VER}.tar.gz
|
||||||
|
|
||||||
# add auth-sso to available extensions folder structur differs from other extensions
|
# add auth-sso to available extensions folder structur differs from other extensions
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
postgresql-hostname: localhost
|
# postgresql-hostname: localhost
|
||||||
postgresql-port: 5432
|
# postgresql-port: 5432
|
||||||
postgresql-database: guacamole_db
|
# postgresql-database: guacamole_db
|
||||||
postgresql-username: guacamole
|
# postgresql-username: guacamole
|
||||||
postgresql-password: null
|
# postgresql-password: null
|
||||||
|
|
||||||
# ldap-hostname: ldap.example.net
|
# ldap-hostname: ldap.example.net
|
||||||
# ldap-port: 389
|
# ldap-port: 389
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv sh
|
|
||||||
|
|
||||||
mkdir -p /config/postgres
|
|
||||||
mkdir -p /var/run/postgresql
|
|
||||||
chown postgres:postgres /var/run/postgresql
|
|
||||||
chown -R postgres:postgres /config/postgres
|
|
||||||
chmod 0700 /config/postgres
|
|
||||||
|
|
||||||
if [ -e /config/postgres/postgresql.conf ]; then
|
|
||||||
echo "Database already configured"
|
|
||||||
else
|
|
||||||
s6-setuidgid postgres initdb
|
|
||||||
fi
|
|
||||||
@@ -6,9 +6,9 @@ for i in auth-ldap auth-duo auth-header auth-cas auth-openid auth-quickconnect a
|
|||||||
done
|
done
|
||||||
|
|
||||||
# if the guacamole version was bumped, delete the contents of the extensions directory - just on the first run
|
# if the guacamole version was bumped, delete the contents of the extensions directory - just on the first run
|
||||||
if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
|
# if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
|
||||||
rm -rf ${GUACAMOLE_HOME}/extensions/*
|
# rm -rf ${GUACAMOLE_HOME}/extensions/*
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# enable extensions
|
# enable extensions
|
||||||
for i in $(echo "$EXTENSIONS" | tr "," " "); do
|
for i in $(echo "$EXTENSIONS" | tr "," " "); do
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
#!/usr/bin/with-contenv sh
|
#!/usr/bin/with-contenv sh
|
||||||
|
|
||||||
until pg_isready; do
|
# until pg_isready; do
|
||||||
echo "Waiting for postgres to come up..."
|
# echo "Waiting for postgres to come up..."
|
||||||
sleep 1
|
# sleep 1
|
||||||
done
|
# done
|
||||||
|
|
||||||
# Create database if it does not exist
|
# Create database if it does not exist
|
||||||
psql -U postgres -lqt | cut -d \| -f 1 | grep -qw $POSTGRES_DB
|
# psql -U postgres -lqt | cut -d \| -f 1 | grep -qw $POSTGRES_DB
|
||||||
if [ $? -ne 0 ]; then
|
# if [ $? -ne 0 ]; then
|
||||||
createuser -U postgres $POSTGRES_USER
|
# createuser -U postgres $POSTGRES_USER
|
||||||
createdb -U postgres -O $POSTGRES_USER $POSTGRES_DB
|
# createdb -U postgres -O $POSTGRES_USER $POSTGRES_DB
|
||||||
cat /app/guacamole/schema/*.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
|
# cat /app/guacamole/schema/*.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
|
||||||
echo "$GUAC_VER" > /config/.database-version
|
# echo "$GUAC_VER" > /config/.database-version
|
||||||
|
|
||||||
/etc/cont-init.d/30-defaults.sh
|
# /etc/cont-init.d/30-defaults.sh
|
||||||
/etc/cont-init.d/50-extensions
|
# /etc/cont-init.d/50-extensions
|
||||||
else
|
# else
|
||||||
if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
|
# if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
|
||||||
cat /app/guacamole/schema/upgrade/upgrade-pre-$GUAC_VER.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
|
# cat /app/guacamole/schema/upgrade/upgrade-pre-$GUAC_VER.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
|
||||||
echo "$GUAC_VER" > /config/.database-version
|
# echo "$GUAC_VER" > /config/.database-version
|
||||||
|
|
||||||
/etc/cont-init.d/30-defaults.sh
|
# /etc/cont-init.d/30-defaults.sh
|
||||||
/etc/cont-init.d/50-extensions
|
# /etc/cont-init.d/50-extensions
|
||||||
fi
|
# fi
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
echo "Starting guacamole client..."
|
echo "Starting guacamole client..."
|
||||||
s6-setuidgid root catalina.sh run
|
s6-setuidgid root catalina.sh run
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv sh
|
|
||||||
|
|
||||||
echo "Starting postgres..."
|
|
||||||
s6-setuidgid postgres postgres
|
|
||||||
Reference in New Issue
Block a user