Skip to content

bag-cnag/rd-connect_cas-dockerfiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RD-Connect CAS / LDAP / UMI containers

  • 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.

Instructions

  1. Download the code

    git clone https://github.com/inab/rd-connect_cas-dockerfiles.git
  2. Enter the directory

    cd rd-connect_cas-dockerfiles
  3. Create the images

    ./generateImages.sh
  4. Enter rd-connect-compose directory

    cd rd-connect-compose
  5. Create the instances

    docker-compose up

Steps to create the containers by hand

Some of the next steps depend on described at README-CA.md.

  1. 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
  2. Build RD-Connect OpenLDAP container, along with its images (to be used by CAS):

    1. 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
    1. 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}"
    1. 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
  3. Build RD-Connect CAS container, tagging it locally:

    1. 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}"
    1. 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
    1. 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 =)"
    1. 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
  4. Steps to create the containers for Web User Management Interface Application.

    1. 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}"
    1. 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
    1. 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
    1. 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
    1. 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
    1. 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/
    1. 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 by umi_data_container
    docker run -d --volumes-from umi_data_container --name rd-connect.eu_umi rd-connect.eu/umi:${UMI_TAG}

About

RD-Connect CAS / LDAP / UMI Dockerfiles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.8%
  • Python 42.2%