Docker快速部署Apache Guacamole

Docker快速部署Apache Guacamole ,实现远程访问

handlebars 复制代码
git clone "https://github.com/boschkundendienst/guacamole-docker-compose.git"
cd guacamole-docker-compose
./prepare.sh
docker-compose up -d

https://IP地址:8443/

用户名:guacadmin

密码:guacadmin

handlebars 复制代码
docker exec -it -u 0 guacamole_compose /bin/bash  
/home/guacamole/tomcat/webapps/guacamole/translations/en.json  #登陆页面文件
/home/guacamole/tomcat/webapps/guacamole/images  #图像文件,包括logo等

云Docker部署Guacamole经frp中转远程连接Windows
docker启动guacamole

使用Docker安装Guacamole远程网关并配置录像回放

handlebars 复制代码
# 创建docker主目录和配置目录
mkdir -p /opt/docker /etc/docker
# 创建docker配置文件
tee /etc/docker/daemon.json <<-'END'
{
    "data-root": "/opt/docker",
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "800m",
        "max-file": "50"
    },
    "registry-mirrors": [
        "https://hub-mirror.c.163.com"
    ]
}
END
# 添加阿里docker镜像源
dnf config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 安装docker docker-compose-plugin
dnf install docker-ce docker-ce
# 启动docker并设置开机自动启动
systemctl enable --now docker
# 查看docker docker-compose版本
docker -v
docker compose version
# 拉取mysql数据库
docker pull mysql:8.0.33-debian
# 拉取guacamole 核心
docker pull guacamole/guacd:1.5.1
# 拉取guacamole Web客户端
docker pull guacamole/guacamole:1.5.1
# 创建程序主目录
mkdir -p /opt/guacamole
# 创建插件目录
mkdir -p /opt/guacamole/extensions
# 创建录像目录
mkdir -p /opt/guacamole/recordings
# 创建数据库初始化脚本目录
mkdir -p /opt/guacamole/initdb.d
# 下载快速链接插件
curl -O https://archive.apache.org/dist/guacamole/1.5.1/binary/guacamole-auth-quickconnect-1.5.1.tar.gz
# 下载录像存储插件
curl -O https://archive.apache.org/dist/guacamole/1.5.1/binary/guacamole-history-recording-storage-1.5.1.tar.gz
# 解压插件
tar -zxvf guacamole-auth-quickconnect-1.5.1.tar.gz
tar -zxvf guacamole-history-recording-storage-1.5.1.tar.gz
# 移动插件至插件目录
mv guacamole-auth-quickconnect-1.5.1/guacamole-auth-quickconnect-1.5.1.jar /opt/guacamole/extensions/
mv guacamole-history-recording-storage-1.5.1/guacamole-history-recording-storage-1.5.1.jar /opt/guacamole/extensions/
# 配置插件目录所有者 1001为guacamole容器内的guacamole用户UID和GID
chown -R 1001.1001 /opt/guacamole/extensions
# 配置插件目录权限
chmod -R 644 /opt/guacamole/extensions
# 配置录像目录所有者
# 1000为guacd容器内的guacd用户UID
# 1001为guacamole容器内的guacamole用户组GID
chown 1000.1001 /opt/guacamole/recordings
# 配置插件目录权限
chmod 2750 /opt/guacamole/recordings
# 运行guacamole容器生成数据库初始化脚本
docker run --rm guacamole/guacamole:1.5.1 /opt/guacamole/bin/initdb.sh --mysql > /opt/guacamole/initdb.d/initdb.sql
# 创建docker-compose.yml容器编排配置文件
vi /opt/guacamole/docker-compose.yml
services:
  guacamole-mysql:
      image: mysql:8.0.33-debian
      container_name: guacamole-mysql
      volumes:
        - /etc/localtime:/etc/localtime:ro
        # 数据库数据绑定至guacamole-mysql-data卷
        - guacamole-mysql-data:/var/lib/mysql
        # 数据库初始化脚本
        - /opt/guacamole/initdb.d/initdb.sql:/docker-entrypoint-initdb.d/initdb.sql
      command:
        - "--character-set-server=utf8"
        - "--collation-server=utf8_bin"
      restart: always
      environment:
        # 数据库root密码
        - MYSQL_ROOT_PASSWORD=2477bb2991dd472094d118ad9bafa0ce
        # 数据库名
        - MYSQL_DATABASE=guacamole
        # 数据库用户
        - MYSQL_USER=guacamole
        # 数据库密码
        - MYSQL_PASSWORD=fea78183e72c4e7798e1d803e2d36109
      expose:
        - "3306"
      networks:
        guacamole_network:

  guacamole-guacd:
    image: guacamole/guacd:1.5.1
    container_name: guacamole-guacd
    volumes:
      - /etc/localtime:/etc/localtime:ro
      # 录像目录
      - /opt/guacamole/recordings:/var/lib/guacamole/recordings
    restart: always
    expose:
        - "4822"
    networks:
      guacamole_network:

  guacamole-web:
    image: guacamole/guacamole:1.5.1
    container_name: guacamole-web
    volumes:
      - /etc/localtime:/etc/localtime:ro
      # 录像目录
      - /opt/guacamole/recordings:/var/lib/guacamole/recordings
      # 插件目录
      - /opt/guacamole/extensions:/etc/guacamole/extensions
    restart: always
    environment:
      # guacd主机名
      - GUACD_HOSTNAME=guacamole-guacd
      # guacd端口
      - GUACD_PORT=4822
      # 首选认证方式
      - EXTENSION_PRIORITY=mysql
      # 数据库主机名
      - MYSQL_HOSTNAME=guacamole-mysql
      # 数据库端口
      - MYSQL_PORT=3306
      # 数据库名
      - MYSQL_DATABASE=guacamole
      # 数据库用户
      - MYSQL_USER=guacamole
      # 数据库密码
      - MYSQL_PASSWORD=fea78183e72c4e7798e1d803e2d36109
      # guacamole主目录(插件、库、配置等)
      - GUACAMOLE_HOME=/etc/guacamole
      # 会话超时时间 单位: 分钟
      - API_SESSION_TIMEOUT=60
    ports:
      - "80:8080"
    networks:
      guacamole_network:


networks:
  guacamole_network:
    name: "guacamole_network"
    driver: bridge
    ipam:
      config:
        - subnet: 172.31.125.0/24
          gateway: 172.31.125.1


volumes:
  # 数据库数据卷
  guacamole-mysql-data:
    name: "guacamole-mysql-data"
# 进入目录
cd /opt/guacamole
# 启动容器
docker compose up -d

LDAP/AD 身份验证

handlebars 复制代码
wget https://dlcdn.apache.org/guacamole/1.4.0/binary/guacamole-auth-ldap-1.4.0.tar.gz
tar xvzf guacamole-auth-ldap-1.4.0.tar.gz
cd guacamole-auth-ldap-1.4.0/
cp guacamole-auth-ldap-1.4.0.jar /etc/guacamole/extensions/

# 在活动目录中新建名为guacadmin的用户
# 在活动目录中新建名为Group_Guacamole_Users的用户组,将guacadmin加入到Group_Guacamole_Users组中,只该用户组中的用户可以登录guacamole

vim /etc/guacamole/guacamole.properties

#LDAP Properties
ldap-hostname: x.x.x.x
ldap-port: 389
ldap-encryption-method: none
ldap-user-base-dn:DC=domain,DC=local
ldap-search-bind-dn:CN=guacadmin,OU=ou,DC=doman,DC=local
ldap-search-bind-password: Password
ldap-username-attribute: sAMAccountName
ldap-user-search-filter: (memberOf=CN= Group_Guacamole_Users,OU=ou,DC=domain,DC=local)

systemctl restart guacd
systemctl restart tomcat
相关推荐
MonkeyKing_sunyuhua1 小时前
ubuntu22.04 docker-compose安装postgresql数据库
数据库·docker·postgresql
追风林2 小时前
mac m1 docker本地部署canal 监听mysql的binglog日志
java·docker·mac
Aloudata3 小时前
从Apache Atlas到Aloudata BIG,数据血缘解析有何改变?
大数据·apache·数据血缘·主动元数据·数据链路
€☞扫地僧☜€3 小时前
docker 拉取MySQL8.0镜像以及安装
运维·数据库·docker·容器
茶馆大橘3 小时前
微服务系列六:分布式事务与seata
分布式·docker·微服务·nacos·seata·springcloud
全能全知者4 小时前
docker快速安装与配置mongoDB
mongodb·docker·容器
阿尔帕兹6 小时前
构建 HTTP 服务端与 Docker 镜像:从开发到测试
网络协议·http·docker
ZHOU西口8 小时前
微服务实战系列之玩转Docker(十八)
分布式·docker·云原生·架构·数据安全·etcd·rbac
小钱c710 小时前
Mac下安装Apache JMeter并启动
jmeter·macos·apache
景天科技苑10 小时前
【云原生开发】K8S多集群资源管理平台架构设计
云原生·容器·kubernetes·k8s·云原生开发·k8s管理系统