generateImages.sh
script automates the RD-Connect CAS images generation with a set of random passwords and self-signed certificates.- Once run,
startInstances.sh
allows creating instances based on all the main images, and starting them.stopInstances.sh
stops those instances.
-
Download the code
git clone https://github.com/inab/rd-connect_cas-dockerfiles.git
-
Enter the directory
cd rd-connect_cas-dockerfiles
-
Create the images
./generateImages.sh
-
Enter rd-connect-compose directory
cd rd-connect-compose
-
Create the instances
docker-compose up
Some of the next steps depend on described at README-CA.md.
-
Build CentOS and OpenJDK common containers, tagging it locally:
docker build -t rd-connect.eu/centos:7 centos_rd-connect docker build -t rd-connect.eu/openjdk:8 openjdk_rd-connect
-
Build RD-Connect OpenLDAP container, along with its images (to be used by CAS):
- If we do not have already one, we generate the ldap_data_container based on centos:7 oficial image:
docker create -v /etc/openldap -v /var/lib/ldap -v /var/log --name ldap_data_container centos:7 /bin/true
- Get the keys for the OpenLDAP image:
CAS_TAG=cas-4.1.x CAS_LDAP_CERTS_FILE=/tmp/cas-ldap-certs.tar LDAP_CERTS_PROFILE=cas-ldap mkdir -p "${PWD}"/openldap_rd-connect/tmp docker run --volumes-from rd-connect_ca-store rd-connect.eu/rd-connect_ca "${LDAP_CERTS_PROFILE}" > "${PWD}"/openldap_rd-connect/"${CAS_LDAP_CERTS_FILE}"
- Build RD-Connect OpenLDAP container:
docker build --build-arg="LDAP_CERTS_PROFILE=${LDAP_CERTS_PROFILE}" --build-arg="CAS_LDAP_CERTS_FILE=${CAS_LDAP_CERTS_FILE}" -t rd-connect.eu/cas-ldap:${CAS_TAG} openldap_rd-connect rm -fr "${PWD}"/openldap_rd-connect/tmp
-
Build RD-Connect CAS container, tagging it locally:
- Generate the certificates bundle to be used by RD-Connect CAS Tomcat:
CAS_TOMCAT_CERTS_FILE=/tmp/cas-tomcat-certs.tar CAS_CERTS_PROFILE=cas-tomcat mkdir -p "${PWD}"/rd-connect-CAS-server/tmp docker run --volumes-from rd-connect_ca-store rd-connect.eu/rd-connect_ca "${CAS_CERTS_PROFILE}" > "${PWD}"/rd-connect-CAS-server/"${CAS_TOMCAT_CERTS_FILE}"
- Build the tomcat image, and generate the cas_tomcat_data_container based on centos:7 oficial image:
TOMCAT_TAG=7.0.75 docker build --build-arg="TOMCAT_TAG=${TOMCAT_TAG}" -t rd-connect.eu/tomcat:${TOMCAT_TAG} -t rd-connect.eu/tomcat:7 tomcat_rd-connect docker create -v /var/log -v /etc/cas -v /etc/tomcat7 --name cas_tomcat_data_container centos:7 /bin/true
- Extract the LDAP admin password from RD-Connect OpenLDAP container
CAS_LDAP_PASS="$(docker run -i -t --rm rd-connect.eu/cas-ldap:cas-4.1.x grep '^domainPass' /etc/openldap/for_sysadmin.txt | cut -f 2 -d =)"
- Build RD-Connect CAS container:
docker build --build-arg="CAS_CERTS_PROFILE=${CAS_CERTS_PROFILE}" --build-arg="CAS_TOMCAT_CERTS_FILE=${CAS_TOMCAT_CERTS_FILE}" --build-arg="CAS_LDAP_PASS=${CAS_LDAP_PASS}" --build-arg="CAS_RELEASE=${CAS_TAG}" -t rd-connect.eu/rdconnect_cas:${CAS_TAG} rd-connect-CAS-server rm -fr "${PWD}"/rd-connect-CAS-server/tmp
-
Steps to create the containers for Web User Management Interface Application.
- Generate the certificates bundle to be used by RD-Connect User Management Interface:
mkdir -p "${PWD}"/phpldapadmin_rd-connect/tmp HTTPD_CERTS_FILE=/tmp/cas-httpd-certs.tar HTTPD_CERTS_PROFILE=cas-httpd docker run --volumes-from rd-connect_ca-store rd-connect.eu/rd-connect_ca "${HTTPD_CERTS_PROFILE}" > "${PWD}"/phpldapadmin_rd-connect/"${HTTPD_CERTS_FILE}"
- Now we build CentOS Apache Web server image, tagging it locally and based on httpd_rd-connect:
HTTPD_TAG=2.4 docker build -t rd-connect.eu/httpd:${HTTPD_TAG} httpd_rd-connect
- We augment it with phpldapadmin, which is going to install the needed certificates:
PLA_TAG=latest docker build --build-arg="HTTPD_CERTS_PROFILE=${HTTPD_CERTS_PROFILE}" --build-arg="HTTPD_CERTS_FILE=${HTTPD_CERTS_FILE}" -t rd-connect.eu/phpldapadmin:${PLA_TAG} phpldapadmin_rd-connect rm -fr "${PWD}"/rd-connect-CAS-server/tmp
- We build the rd-connect.eu/rdconnect-umi-prereqs image
UMI_TAG=latest docker build -t rd-connect.eu/rdconnect-umi-prereqs:${UMI_TAG} umi-prereqs_rd-connect
- Now we build the rd-connect.eu/rdconnect-umi image that will create container to deploy user management interface
UMI_TAG=latest docker build --build-arg="CAS_LDAP_PASS=${CAS_LDAP_PASS}" -t rd-connect.eu/rdconnect-umi:${UMI_TAG} umi_rd-connect
- We generate the umi_data_container based on centos:7 oficial image:
docker create -v /var/log/httpd -v /etc/openldap -v /etc/phpldapadmin --name umi_data_container centos:7 /bin/true docker cp blblblblblb umi_data_container:/etc/
- Last, we run rd-connect.eu/umi based on rd-connect.eu/umi:${UMI_TAG} image, giving it a name of
rd-connect.eu_umi
and mounting volumes exported byumi_data_container
docker run -d --volumes-from umi_data_container --name rd-connect.eu_umi rd-connect.eu/umi:${UMI_TAG}