├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── deployerConfigContext.xml └── mysql-connector-java-5.1.28-bin.jar /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wnameless/mysql-phpmyadmin 2 | 3 | MAINTAINER Wei-Ming Wu 4 | 5 | # Install libfuse2 6 | RUN apt-get install -y libfuse2; \ 7 | cd /tmp; \ 8 | apt-get download fuse; \ 9 | dpkg-deb -x fuse_* .; \ 10 | dpkg-deb -e fuse_*; \ 11 | rm fuse_*.deb; \ 12 | echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst; \ 13 | dpkg-deb -b . /fuse.deb; \ 14 | dpkg -i /fuse.deb 15 | 16 | # Install Java 7 17 | RUN apt-get install -y openjdk-7-jdk 18 | 19 | # Install Tomcat 7 20 | RUN apt-get install -y tomcat7 tomcat7-admin 21 | RUN sed -i "s###g" /etc/tomcat7/tomcat-users.xml; \ 22 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 23 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 24 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 25 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 26 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 27 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 28 | echo ' ' >> /etc/tomcat7/tomcat-users.xml; \ 29 | echo '' >> /etc/tomcat7/tomcat-users.xml 30 | 31 | # Configure https 32 | RUN sed -i "s###g" /etc/tomcat7/server.xml; \ 33 | sed -i "s# ##g" /etc/tomcat7/server.xml; \ 34 | echo ' ' >> /etc/tomcat7/server.xml; \ 35 | echo ' ' >> /etc/tomcat7/server.xml; \ 36 | echo '' >> /etc/tomcat7/server.xml 37 | 38 | # Install CAS server 39 | RUN cd /tmp; \ 40 | wget http://downloads.jasig.org/cas/cas-server-3.5.2-release.tar.gz; \ 41 | tar xzvf cas-server-3.5.2-release.tar.gz; \ 42 | cp cas-server-3.5.2/modules/cas-server-webapp-3.5.2.war /var/lib/tomcat7/webapps/cas.war; \ 43 | service tomcat7 start; \ 44 | sleep 10; \ 45 | service tomcat7 stop; \ 46 | cp cas-server-3.5.2/modules/cas-server-support-jdbc-3.5.2.jar /var/lib/tomcat7/webapps/cas/WEB-INF/lib 47 | 48 | # Create CAS authentication DB 49 | RUN chmod 1777 /tmp; \ 50 | mysqld & \ 51 | sleep 5; \ 52 | echo "CREATE DATABASE cas" | mysql -u root; \ 53 | echo "CREATE TABLE cas_users (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, password VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (id), UNIQUE KEY (username))"| mysql -u root -D cas; \ 54 | echo "INSERT INTO cas_users (username, password) VALUES ('guest', '084e0343a0486ff05530df6c705c8bb4')" | mysql -u root -D cas; \ 55 | sleep 10 56 | 57 | # Replace CAS deployerConfigContext.xml & install MySQL driver 58 | ADD deployerConfigContext.xml / 59 | ADD mysql-connector-java-5.1.28-bin.jar / 60 | RUN mv deployerConfigContext.xml /var/lib/tomcat7/webapps/cas/WEB-INF/deployerConfigContext.xml; \ 61 | mv mysql-connector-java-5.1.28-bin.jar /var/lib/tomcat7/webapps/cas/WEB-INF/lib 62 | 63 | EXPOSE 22 64 | EXPOSE 80 65 | EXPOSE 3306 66 | EXPOSE 8080 67 | EXPOSE 8443 68 | 69 | CMD chmod 1777 /tmp; \ 70 | mysqld_safe & \ 71 | service apache2 start; \ 72 | [ ! -f /usr/share/tomcat7/.keystore ] && printf tomcat_admin\\ntomcat_admin\\n\\n\\n\\n\\n\\n\\ny\\ntomcat_admin\\ntomcat_admin\\n | keytool -genkey -alias tomcat -keyalg RSA -keystore /usr/share/tomcat7/.keystore; \ 73 | service tomcat7 start; \ 74 | /usr/sbin/sshd -D 75 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright [2014] [Wei-Ming Wu] 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-cas_mysql 2 | ============================ 3 | 4 | ``` 5 | docker pull wnameless/cas-mysql 6 | ``` 7 | 8 | Run with 22, 80, 8080, 8443 and 3306 ports opened: 9 | ``` 10 | docker run -d -p 49160:22 -p 49161:80 -p 49162:8080 -p 49163:8443 -p 49164:3306 wnameless/cas-mysql 11 | ``` 12 | 13 | Login the CAS server https://localhost:49163/cas/login with following credential: 14 | ``` 15 | username: guest 16 | password: guest 17 | ``` 18 | It's just a demo account. You can create more account by phpMyAdmin. 19 | Be aware that all passwords suppose to be hashed by MD5. 20 | 21 | Open http://localhost:49161/phpmyadmin in your browser with following credential: 22 | ``` 23 | username: root 24 | password: 25 | ``` 26 | 27 | Open Tomcat web admin http://localhost:49162/manager/html with following credential: 28 | ``` 29 | username: admin 30 | password: admin 31 | ``` 32 | 33 | Login by SSH 34 | ``` 35 | ssh root@localhost -p 49160 36 | password: admin 37 | ``` 38 | -------------------------------------------------------------------------------- /deployerConfigContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 35 | 36 | 44 | 52 | 54 | 55 | 65 | 66 | 81 | 82 | 83 | 91 | 92 | 93 | 94 | 102 | 104 | 105 | 106 | 107 | 113 | 114 | 115 | 119 | 121 | 128 | 130 | 131 | 132 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 168 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 184 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 201 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 221 | 228 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /mysql-connector-java-5.1.28-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wnameless/docker-cas_mysql/48fd5de6e4547dd050737d6979afdf20d8d1ae48/mysql-connector-java-5.1.28-bin.jar --------------------------------------------------------------------------------