This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from docker/first-run
First run
- Loading branch information
Showing
22 changed files
with
999 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
FROM bigfleet/shibboleth_sp | ||
|
||
# Define args and set a default value | ||
ARG registry=docker.io | ||
ARG maintainer=tier | ||
ARG imagename=comanage | ||
ARG version=1.0.5 | ||
|
||
MAINTAINER $maintainer | ||
LABEL Vendor="Internet2" | ||
LABEL ImageType="COmanage" | ||
LABEL ImageName=$imagename | ||
LABEL ImageOS=centos7 | ||
LABEL Version=$version | ||
|
||
LABEL Build docker build --rm --tag $registry/$maintainer/$imagename . | ||
|
||
# Install deps | ||
RUN yum -y install --setopt=tsflags=nodocs \ | ||
httpd \ | ||
mariadb \ | ||
mysql-devel \ | ||
mysql-libs \ | ||
mod_ssl \ | ||
php \ | ||
php-openssl \ | ||
php-cli \ | ||
php-ldap \ | ||
php-mbstring \ | ||
php-mcrypt \ | ||
php-mysql \ | ||
php-pear-MDB2-Driver-mysqli \ | ||
php-pecl-memcached \ | ||
php-xml \ | ||
vim && yum -y clean all | ||
|
||
# | ||
# Global PHP configuration changes | ||
# | ||
RUN sed -i \ | ||
-e 's~^;date.timezone =$~date.timezone = Europe/Rome~g' \ | ||
-e 's~^;user_ini.filename =$~user_ini.filename =~g' \ | ||
/etc/php.ini | ||
|
||
RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php | ||
|
||
ENV VERSION=$version | ||
ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz | ||
ENV COMANAGE_PREFIX=comanage-registry | ||
|
||
RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \ | ||
wget -q $COMANAGE_URL && \ | ||
# Perform verifications [TODO] | ||
# Prepare filesystem | ||
mkdir -p /opt/comanage && \ | ||
tar xf $VERSION.tar.gz && \ | ||
mv $COMANAGE_PREFIX-$VERSION /opt/comanage/. && \ | ||
ln -s /opt/comanage/$VERSION /opt/comanage/current && \ | ||
# # Cleanup | ||
rm -rf /tmp/comanage | ||
|
||
ENV COMANAGE_HOME /opt/comanage/current | ||
|
||
WORKDIR $COMANAGE_HOME | ||
|
||
# Add starters and installers | ||
ADD ./container_files /opt | ||
|
||
# Add Volumes and Set permissions | ||
RUN mkdir /opt/shared \ | ||
&& chmod 777 /opt/shared \ | ||
&& chmod 777 /opt/bin/*.sh | ||
|
||
# Environment variables | ||
ENV ADMIN_NAME "Scott" | ||
ENV ADMIN_FAMILY "Koranda" | ||
ENV ADMIN_USERNAME "scott.koranda@sphericalcowgroup.com" | ||
ENV COMANAGE_SERVER_FQDN "comanage.testbed.tier.internet2.edu" | ||
ENV COMANAGE_MAIL_FROM "comanage_registry@picard.cgac.uwm.edu" | ||
ENV COMANAGE_MAIL_HOST "localhost" | ||
ENV COMANAGE_MAIL_PORT "25" | ||
ENV COMANAGE_MAIL_USER "user" | ||
ENV COMANAGE_MAIL_PASS "secret" | ||
ENV MYSQL_HOST "i2mariadb" | ||
ENV MYSQL_DATABASE "registry" | ||
ENV MYSQL_USER "registry_user" | ||
ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7" | ||
ENV TERM "testterm" | ||
# How long will we wait for MariaDB to start up? | ||
ENV WAIT_TIME 60 | ||
|
||
# Required volumes for mounting Shibboleth SSL files into container | ||
VOLUME /opt/shibboleth/ssl/ | ||
|
||
# Required volumes for mounting Apache SSL files into container | ||
VOLUME /opt/httpd/ssl/ | ||
|
||
# Port | ||
EXPOSE 80 443 | ||
|
||
CMD ["/opt/bin/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
maintainer="bigfleet" | ||
imagename="comanage" | ||
imagename="comanage" | ||
version="1.0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
/opt/bin/configure_httpd.sh | ||
|
||
/opt/bin/configure_php.sh | ||
|
||
/opt/bin/configure_shibd.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
log="/tmp/httpd.log" | ||
|
||
echo "Configuring httpd: " > $log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
log="/tmp/php.log" | ||
|
||
echo "Configuring php: " > $log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
log="/tmp/shibd.log" | ||
|
||
echo "Configuring shibd: " > $log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -x | ||
|
||
log="/tmp/start-main.log" | ||
|
||
echo "Starting Container: " > $log | ||
date >> $log | ||
echo "" >> $log | ||
|
||
if [ -e "/tmp/firsttimerunning" ]; then | ||
|
||
set -e | ||
|
||
/opt/bin/configure.sh >> $log | ||
|
||
/opt/bin/cleanup.sh >> $log | ||
|
||
else | ||
echo "COmanage container has run." >> $log | ||
echo "If there are problems, docker rm this container and try again." >> $log | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
log="/tmp/start-starting.log" | ||
date >> $log | ||
if [ -z ${COMPOSE+x} ] | ||
then | ||
echo "Not composed so not waiting for MariaDB: " > $log | ||
/opt/bin/main.sh | ||
laststatus="$?" | ||
echo "Not composed status: $laststatus" | ||
if [ "$laststatus" != "0" ]; then | ||
echo "Not composed non-zero exit status: $laststatus" >> $log | ||
echo "Not composed non-zero exit status: $laststatus" | ||
exit 1 | ||
else | ||
echo "COmanage was configured" >>$log | ||
echo "COmanage was configured" | ||
echo "Starting apache" >>$log | ||
echo "Starting apache" | ||
/usr/local/bin/httpd-shib-foreground & | ||
fi | ||
else | ||
echo "Composed so waiting for MariaDB: " > $log | ||
date >> $log | ||
echo "Testing connectivity to database before continue with install" >> $log | ||
echo "Testing connectivity to database before continue with install" | ||
/opt/wait-for-it/wait-for-it.sh $MYSQL_HOST:3306 -t $WAIT_TIME --strict -- /opt/bin/main.sh | ||
|
||
date >> $log | ||
echo "Starting apache" >>$log | ||
echo "Starting apache" | ||
/usr/local/bin/httpd-shib-foreground & | ||
fi |
Oops, something went wrong.