基于docker搭建CAS

0x00 拉取镜像

docker pull apereo/cas:v5.3.10

0x01 启动容器

docker run  --name cas -p 8443:8443 -p 8080:8080  apereo/cas:v5.3.10 /bin/sh /cas-overlay/bin/run-cas.sh

此步骤会经历漫长的编译构建过程。

0x02 配置容器

生成keystore

keytool -genkeypair -alias cas -keyalg RSA -keypass changeit \
        -storepass changeit -keystore ./thekeystore \
        -dname "CN=cas.example.org,OU=Example,OU=Org,C=AU" \
        -ext SAN="dns:example.org,dns:localhost,ip:127.0.0.1"

拷贝证书到容器中

docker cp thekeystore cas:/etc/cas/thekeystore

添加cas.example.org到hosts文件中

echo '127.0.0.1 cas.example.org' >> /etc/hosts

等到容器配置完,构建完,重启容器。

docker restart cas

0x03 访问cas

访问地址为:https://127.0.0.1:8443/cas/login
casuser/Mellon

参考链接

https://www.cnblogs.com/zhzhlong/p/11551361.html
https://apereo.github.io/cas/5.1.x/installation/Docker-Installation.html
https://github.com/apereo/cas-webapp-docker

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容