From f0355f99820d44f16421f5abede88c2b10af3382 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 10 Jan 2026 23:21:13 +0100 Subject: [PATCH] - Initial release, - Based on rx3-docker/tomcat:1.0.0-mga9 & rx3-docker/postgresql:1.1.5-mga9 images. - Use guacamole-server 1.6.0 from Rx3 RPM. --- .gitignore | 2 + Dockerfile-client | 45 +++++++ Dockerfile-server | 29 +++++ ReadMe.txt | 19 +++ ReleaseNotes.txt | 7 ++ compose.yaml | 156 +++++++++++++++++++++++++ env.dist | 114 ++++++++++++++++++ var/lib/pgsql/.gitignore | 4 + var/log/guacd/.gitignore | 4 + var/log/init-database/.gitignore | 4 + var/log/init-server/.gitignore | 4 + var/log/init-webapp/.gitignore | 4 + var/log/postgres/.gitignore | 4 + var/log/supervisor-database/.gitignore | 4 + var/log/supervisor-server/.gitignore | 4 + var/log/supervisor-webapp/.gitignore | 4 + var/log/tomcat/.gitignore | 4 + 17 files changed, 412 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile-client create mode 100644 Dockerfile-server create mode 100644 ReadMe.txt create mode 100644 ReleaseNotes.txt create mode 100644 compose.yaml create mode 100644 env.dist create mode 100644 var/lib/pgsql/.gitignore create mode 100644 var/log/guacd/.gitignore create mode 100644 var/log/init-database/.gitignore create mode 100644 var/log/init-server/.gitignore create mode 100644 var/log/init-webapp/.gitignore create mode 100644 var/log/postgres/.gitignore create mode 100644 var/log/supervisor-database/.gitignore create mode 100644 var/log/supervisor-server/.gitignore create mode 100644 var/log/supervisor-webapp/.gitignore create mode 100644 var/log/tomcat/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..556bc65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.old diff --git a/Dockerfile-client b/Dockerfile-client new file mode 100644 index 0000000..55922f3 --- /dev/null +++ b/Dockerfile-client @@ -0,0 +1,45 @@ +# Rx3-Docker/Guacamole Dockerfile +#------------------------------------------------------------------------------- + +ARG IMG_FROM_URL="rx3-docker/tomcat:latest" + +FROM ${IMG_FROM_URL} + +ARG IMG_NAME +ARG IMG_NAME_FULL +ARG IMG_VERSION +ARG IMG_MAINTAINER + +LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL} +LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} +LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} +LABEL maintainer=${IMG_MAINTAINER} + +ARG GUACAMOLE_LIB_DIR=/var/lib/guacamole +ARG GUACAMOLE_CONFIG_DIR=/etc/guacamole +ARG GUACAMOLE_CONFIG_FILE=${GUACAMOLE_CONFIG_DIR}/guacamole.properties + + + +#-------------------------------------------------------------------------------------------------------------------------------- +ARG GUACAMOLED='#!/bin/bash \n\ + \n\ +chown -R root:tomcat '${GUACAMOLE_LIB_DIR}' '${GUACAMOLE_CONFIG_DIR}' \n\ + \n\ +sed -i -e "s/guacd-hostname: .*/guacd-hostname: ${GUACD_HOST}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/guacd-port: .*/guacd-port: ${GUACD_PORT}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/postgresql-hostname: .*/postgresql-hostname: ${POSTGRESQL_HOST}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/postgresql-port: .*/postgresql-port: ${POSTGRESQL_PORT}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/postgresql-database: .*/postgresql-database: ${POSTGRESQL_DATABASE}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/postgresql-username: .*/postgresql-username: ${POSTGRESQL_USER}/" '${GUACAMOLE_CONFIG_FILE}' \n\ +sed -i -e "s/postgresql-password: .*/postgresql-password: ${POSTGRESQL_PASSWORD}/" '${GUACAMOLE_CONFIG_FILE} +#-------------------------------------------------------------------------------------------------------------------------------- + + + +RUN urpmi.update -a \ + && urpmi --force guacamole-client \ + && echo -e "${GUACAMOLED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/guacamoled \ + && chmod a+x /etc/init.d/guacamoled \ + && ln -s /etc/init.d/guacamoled /etc/rcD.d/S50guacamoled + diff --git a/Dockerfile-server b/Dockerfile-server new file mode 100644 index 0000000..b907139 --- /dev/null +++ b/Dockerfile-server @@ -0,0 +1,29 @@ +# Rx3-Docker/Guacamole Dockerfile +#------------------------------------------------------------------------------- + +ARG IMG_FROM_URL="rx3-docker/server:latest" + +FROM ${IMG_FROM_URL} + +ARG IMG_NAME +ARG IMG_NAME_FULL +ARG IMG_VERSION +ARG IMG_MAINTAINER + +LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL} +LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} +LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} +LABEL maintainer=${IMG_MAINTAINER} + + + +#--------------------------------------------------------------------------------------------------- +ARG GUACD_INI='[program:guacd] \n\ +command=guacd -b 0.0.0.0 -L info -f' +#--------------------------------------------------------------------------------------------------- + + + +RUN urpmi.update -a \ + && urpmi --force guacamole-server \ + && echo -e "${GUACD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/guacd.ini diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..5930f21 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,19 @@ +Welcome to Rx3-Docker/Guacamole docker image! + + + +This project aims to build a Guacamole docker image. + +Features: + - Curtently based on rx3-docker/tomcat:1.0.0-mga9 & rx3-docker/postgresql:1.1.5-mga9 images, + - Sync with Guacamole 1.6.0. + + + +Enjoy it! + +Your Rx3 Team. + +-- +arnaud@rx3.net +https://git.rx3.org/gitea/rx3-docker/guacamole diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt new file mode 100644 index 0000000..0b142bf --- /dev/null +++ b/ReleaseNotes.txt @@ -0,0 +1,7 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3-Docker/Gitea V 1.0.0 - A. GIBERT - 2026/01/10 +------------------------------------------------------------------------------------------------------------------------------------ + +- Initial release, +- Based on rx3-docker/tomcat:1.0.0-mga9 & rx3-docker/postgresql:1.1.5-mga9 images. +- Use guacamole-server 1.6.0 from Rx3 RPM. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..c0383ce --- /dev/null +++ b/compose.yaml @@ -0,0 +1,156 @@ +# Rx3-Docker/Guacamole Docker Image +#------------------------------------------------------------------------------- + +name: ${HOST_NAME_PREFIX} + +services: + database: + container_name: ${DB_HOST_NAME} + hostname: ${DB_HOST_NAME} + + image: ${DB_IMG_URL} + + restart: unless-stopped + + environment: + POSTGRESQL_UID: ${DB_USER_ID} + POSTGRESQL_GID: ${DB_GROUP_ID} + POSTGRESQL_POSTGRES_PASSWORD: ${DB_POSTGRES_PASSWORD} + POSTGRESQL_DATABASE: ${DB_NAME} + POSTGRESQL_USER: ${DB_USER} + POSTGRESQL_PASSWORD: ${DB_PASSWORD} + + healthcheck: + test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_NAME}'"] + interval: 10s + timeout: 3s + retries: 3 + + volumes: + - ./${DB_LIB_EXT}:${DB_LIB_INT} + - ./${DB_LOG_INIT_EXT}:${DB_LOG_INIT_INT} + - ./${DB_LOG_SV_EXT}:${DB_LOG_SV_INT} + - ./${DB_LOG_MAIN_EXT}:${DB_LOG_MAIN_INT} + + networks: + - appl + +# ports: +# - "127.0.0.1:${DB_PORT_SV_EXT}:${DB_PORT_SV_INT}" +# - "127.0.0.1:${DB_PORT_MAIN_EXT}:${DB_PORT_MAIN_INT}" + + + +#------------------------------------------------------------------------------- + + server: + container_name: ${SV_HOST_NAME} + hostname: ${SV_HOST_NAME} + + image: ${SV_IMG_URL} + + build: + dockerfile: Dockerfile-server + + context: . + + args: + IMG_NAME: ${SV_IMG_URL} + IMG_NAME_FULL: ${SV_IMG_NAME_FULL} + IMG_VERSION: ${SV_IMG_VERSION} + IMG_MAINTAINER: ${APPL_MAINTAINER} + IMG_FROM_URL: ${SV_IMG_FROM_URL} + + restart: unless-stopped + + environment: + SERVER_CROND_ENABLED: ${SV_CROND_ENABLED} + GUACAMOLE_UID: ${SV_USER_ID} + GUACAMOLE_GID: ${SV_GROUP_ID} + + volumes: + - ./${SV_LOG_INIT_EXT}:${SV_LOG_INIT_INT} + - ./${SV_LOG_SV_EXT}:${SV_LOG_SV_INT} + - ./${SV_LOG_MAIN_EXT}:${SV_LOG_MAIN_INT} + + networks: + - appl +# - internal + + ports: + - "127.0.0.1:${SV_PORT_SV_EXT}:${SV_PORT_SV_INT}" +# - "127.0.0.1:${SV_PORT_MAIN_EXT}:${SV_PORT_MAIN_INT}" + +#------------------------------------------------------------------------------- + + webapp: + container_name: ${WA_HOST_NAME} + hostname: ${WA_HOST_NAME} + + image: ${WA_IMG_URL} + + build: + dockerfile: Dockerfile-client + + context: . + + args: + IMG_NAME: ${WA_IMG_URL} + IMG_NAME_FULL: ${WA_IMG_NAME_FULL} + IMG_VERSION: ${WA_IMG_VERSION} + IMG_MAINTAINER: ${APPL_MAINTAINER} + IMG_FROM_URL: ${WA_IMG_FROM_URL} + + restart: unless-stopped + + depends_on: + database: + condition: service_healthy + + environment: + SERVER_CROND_ENABLED: ${WA_CROND_ENABLED} + TOMCAT_UID: ${WA_USER_ID} + TOMCAT_GID: ${WA_GROUP_ID} + + GUACD_HOST: ${SV_HOST_NAME} + GUACD_PORT: ${SV_PORT_MAIN_INT} + + POSTGRESQL_HOST: ${DB_HOST_NAME} + POSTGRESQL_PORT: ${DB_PORT_MAIN_INT} + POSTGRESQL_DATABASE: ${DB_NAME} + POSTGRESQL_USER: ${DB_USER} + POSTGRESQL_PASSWORD: ${DB_PASSWORD} + + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:${WA_PORT_MAIN_INT}/guacamole/"] + interval: 10s + timeout: 3s + retries: 3 + + volumes: + - ./${WA_LOG_INIT_EXT}:${WA_LOG_INIT_INT} + - ./${WA_LOG_SV_EXT}:${WA_LOG_SV_INT} + - ./${WA_LOG_TOMCAT_EXT}:${WA_LOG_TOMCAT_INT} + + networks: + - appl +# - internal + + ports: + - "127.0.0.1:${WA_PORT_SV_EXT}:${WA_PORT_SV_INT}" + - "127.0.0.1:${WA_PORT_MAIN_EXT}:${WA_PORT_MAIN_INT}" + +networks: + appl: + name: ${NETWORK_NAME} + driver: bridge + driver_opts: + com.docker.network.bridge.name: ${NETWORK_IF_NAME} +# ipam: +# config: +# - subnet: 10.2.33.0/24 +# gateway: 10.2.33.254 + +# internal: +# name: mantisbt-squashtm-internal +# external: true diff --git a/env.dist b/env.dist new file mode 100644 index 0000000..6ed7d59 --- /dev/null +++ b/env.dist @@ -0,0 +1,114 @@ +# Rx3-Docker/Guacamole Docker Image +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Global Settings +#------------------------------------------------------------------------------- + +ORG_NAME="rx3-docker" +ORG_REGISTRY="docker.xor.rx3:5000" + +ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}" + + + +#------------------------------------------------------------------------------- +# Image Settings +#------------------------------------------------------------------------------- + +APPL_NAME="guacamole" +APPL_NAME_FULL="Guacamole Server" +APPL_NAME_SHORT="guacml" +APPL_ORG="rx3-docker" +APPL_VERSION="1.0.0" +APPL_MAINTAINER='"Arnaud G. GIBERT" ' + + + +#------------------------------------------------------------------------------- +# User Settings +#------------------------------------------------------------------------------- + +#APPL_ENV="prd" +#APPL_ENV="tst" +#APPL_ENV="int" +APPL_ENV="dvp" + +WA_REPOS_EXT=./var/lib/guacamole/repositories + + + +#------------------------------------------------------------------------------- +# Common +#------------------------------------------------------------------------------- + +if [[ "${APPL_ENV}" != "prd" ]] +then + APPL_SUFFIX="-${APPL_ENV}" + PORT_ENV_OFFSET=100 +else + APPL_SUFFIX="" + PORT_ENV_OFFSET=0 +fi + +ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}" +APPL_URL_PREFIX="${ORG_REGISTRY}/${APPL_ORG}/${APPL_NAME_SHORT}" + +HOST_NAME_PREFIX=${APPL_NAME_SHORT}${APPL_SUFFIX} + +PORT_ENV_OFFSET=0 + +PORT_SV_INT=9001 +PORT_SV_OFFSET=1000 + +NETWORK_NAME=${HOST_NAME_PREFIX} +NETWORK_IF_NAME=br-${HOST_NAME_PREFIX} + +DOCKER_TOOLS_DEBUG=FALSE +DOCKER_TOOLS_VOLUME=MIXED +#DOCKER_TOOLS_VOLUME=MERGED +DOCKER_TOOLS_EXEPTION_LIBS="postgres:pgsql" + + + +#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ +# | Variable | Service | Target Image | From Image | Module | Main Port | Admin Port | User | Group | +# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id | +#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ + +docker_service_add DB database ${ORG_URL_PREFIX} postgresql - 1.1.5-mga9 - - - postgres - - 5432 - - postgres postgres + +docker_service_add SV server ${ORG_URL_PREFIX} guacd "Rx3-Docker/Guacamole Server" ${APPL_VERSION}-mga9 ${ORG_URL_PREFIX} server 1.2.7-mga9 - - - 4822 - - apache apache +docker_service_add WA webapp ${ORG_URL_PREFIX} guacamole "Rx3-Docker/Guacamole Client" ${APPL_VERSION}-mga9 ${ORG_URL_PREFIX} tomcat 1.0.0-mga9 - - 8078 8080 - - apache apache + + + +#------------------------------------------------------------------------------- +# Database +#------------------------------------------------------------------------------- + +DB_POSTGRES_PASSWORD="postgresadmin" +DB_NAME="guacamole" +DB_USER="guacamole" +DB_PASSWORD="guacamoleadmin" + +DB_SERVER_NAME="Guacamole" + + + +#------------------------------------------------------------------------------- +# Server +#------------------------------------------------------------------------------- + +SV_CROND_ENABLED="FALSE" + + + +#------------------------------------------------------------------------------- +# WebApp +#------------------------------------------------------------------------------- + +WA_CROND_ENABLED="FALSE" + +WA_LOG_TOMCAT_EXT=./var/log/tomcat +WA_LOG_TOMCAT_INT=/var/log/tomcat diff --git a/var/lib/pgsql/.gitignore b/var/lib/pgsql/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/lib/pgsql/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/guacd/.gitignore b/var/log/guacd/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/guacd/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init-database/.gitignore b/var/log/init-database/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-database/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init-server/.gitignore b/var/log/init-server/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-server/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init-webapp/.gitignore b/var/log/init-webapp/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-webapp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/postgres/.gitignore b/var/log/postgres/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/postgres/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-database/.gitignore b/var/log/supervisor-database/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-database/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-server/.gitignore b/var/log/supervisor-server/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-server/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-webapp/.gitignore b/var/log/supervisor-webapp/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-webapp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/tomcat/.gitignore b/var/log/tomcat/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/tomcat/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore