Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
1,648 additions
and
0 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 @@ | ||
.idea/** |
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,52 @@ | ||
# COMANAGE # | ||
|
||
ARG COMANAGE_REGISTRY_VERSION | ||
ENV COMANAGE_REGISTRY_VERSION ${COMANAGE_REGISTRY_VERSION:-develop} | ||
|
||
ARG COMANAGE_REGISTRY_SRC_URL | ||
ENV COMANAGE_REGISTRY_SRC_URL=https://github.com/Internet2/comanage-registry/archive/${COMANAGE_REGISTRY_VERSION}.tar.gz | ||
|
||
LABEL comanage_registry_version=${COMANAGE_REGISTRY_VERSION} | ||
LABEL comanage_registry_src_url=${COMANAGE_REGISTRY_SRC_URL} | ||
|
||
ARG COMANAGE_REGISTRY_DIR | ||
ENV COMANAGE_REGISTRY_DIR ${COMANAGE_REGISTRY_DIR:-/srv/comanage-registry} | ||
|
||
FROM i2incommon/comanage-base:latest | ||
|
||
RUN yum -y update && yum -y install \ | ||
busybox \ | ||
&& yum clean -y all | ||
|
||
WORKDIR "$COMANAGE_REGISTRY_DIR" | ||
|
||
RUN mkdir -p "${COMANAGE_REGISTRY_DIR}" \ | ||
&& wget -O comanage.tar.gz ${COMANAGE_REGISTRY_SRC_URL} \ | ||
&& tar -zxf comanage.tar.gz -C ${COMANAGE_REGISTRY_DIR} --strip-components=1 \ | ||
&& rm -f comanage.tar.gz \ | ||
&& rm -rf ${COMANAGE_REGISTRY_DIR}/app/tmp \ | ||
&& cp -r ${COMANAGE_REGISTRY_DIR}/app/tmp.dist ${COMANAGE_REGISTRY_DIR}/app/tmp \ | ||
&& chown -R apache:apache ${COMANAGE_REGISTRY_DIR}/app/tmp \ | ||
&& cd ${COMANAGE_REGISTRY_DIR}/local \ | ||
&& ln -s ${COMANAGE_REGISTRY_DIR}/app/tmp tmp \ | ||
&& chown -h apache:apache ${COMANAGE_REGISTRY_DIR}/local/tmp \ | ||
&& cd /var/www/html \ | ||
&& ln -s ${COMANAGE_REGISTRY_DIR}/app/webroot registry | ||
|
||
COPY --chown=root:root slashRoot/etc/crontab /etc/crontab | ||
COPY --chown=root:root slashRoot/srv/comanage-registry/local/crontab /srv/comanage-registry/local/crontab | ||
COPY --chown=root:root slashRoot/etc/ldap/ldap.conf /etc/ldap/ldap.conf | ||
COPY slashRoot/usr/local/lib/comanage_utils.sh /usr/local/lib/ | ||
|
||
RUN chmod +x /usr/local/lib/comanage_utils.sh | ||
|
||
RUN /usr/bin/crontab -u apache /srv/comanage-registry/local/crontab \ | ||
&& /usr/sbin/usermod --shell /bin/bash apache \ | ||
&& touch /etc/default/locale | ||
|
||
COPY slashRoot/usr/local/bin/docker-comanage-cron-entrypoint /usr/local/bin/ | ||
|
||
ENTRYPOINT ["docker-comanage-cron-entrypoint"] | ||
|
||
CMD ["/usr/sbin/crond", "-n"] | ||
|
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,3 @@ | ||
maintainer="i2incommon" | ||
imagename="comanage-registry-cron" | ||
comanage_version="4.3.4" |
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 | ||
|
||
IMAGENAME=$1 | ||
TAG=$2 | ||
COMANAGE_REGISTRY_VERSION=$3 | ||
DOCKERHUBPW=$4 | ||
SUB=multiarch | ||
|
||
echo "image name: ${IMAGENAME}" | ||
echo "tag name: ${TAG}" | ||
echo "comanage registry version: ${COMANAGE_REGISTRY_VERSION}" | ||
|
||
docker login -u tieradmin -p $DOCKERHUBPW | ||
# NOTE: docker buildx ls when ran using backticks, returns the | ||
# output of a plain ls run. If we do the flow below we get | ||
# the expected output | ||
docker buildx ls | awk '{if (NR>1) {print $1}}' > farm.txt | ||
# Preview the farm.txt file | ||
echo `cat farm.txt` | ||
# Parse the farm.txt file | ||
DOCKER_FARMS=`cat farm.txt` | ||
# Now remove the temporary file | ||
rm -f farm.txt | ||
|
||
if [[ "$DOCKER_FARMS" == *"$SUB"* ]]; then | ||
echo "Farm multiarch exists" | ||
else | ||
docker buildx create --use --name multiarch --append | ||
fi | ||
|
||
docker buildx inspect --bootstrap | ||
docker buildx build --no-cache --platform linux/amd64 -t ${IMAGENAME}_${TAG} --build-arg COMANAGE_REGISTRY_VERSION=${comanage_version} --load . | ||
docker buildx build --no-cache --platform linux/arm64 -t ${IMAGENAME}_${TAG}:arm64 --build-arg COMANAGE_REGISTRY_VERSION=${comanage_version} --load . |
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,35 @@ | ||
#!/bin/bash | ||
|
||
IMAGENAME=$1 | ||
TAG=$2 | ||
SUB=multiarch | ||
|
||
docker buildx ls | awk '{if (NR>1) {print $1}}' > farm.txt | ||
# Preview the farm.txt file | ||
echo `cat farm.txt` | ||
# Parse the farm.txt file | ||
DOCKER_FARMS=`cat farm.txt` | ||
# Now remove the temporary file | ||
rm -f farm.txt | ||
|
||
if [[ "$DOCKER_FARMS" == *"$SUB"* ]]; then | ||
echo "Farm multiarch exists" | ||
else | ||
docker buildx create --use --name multiarch --append | ||
fi | ||
|
||
echo 'list docker processes' | ||
docker ps --all | ||
echo 'list all the docker images' | ||
docker image ls | ||
echo 'remove the amd64 docker image' | ||
docker rmi ${IMAGENAME}_${TAG} --force | ||
echo 'remove the arm64 docker image' | ||
docker rmi ${IMAGENAME}_${TAG}:arm64 --force | ||
|
||
echo "Remove all dangling images" | ||
docker image prune -a --force | ||
echo "Clear the build cache" | ||
docker buildx prune --force | ||
echo 'list all the docker images' | ||
docker image ls |
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,3 @@ | ||
SHELL=/bin/sh | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
MAILTO="" |
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 @@ | ||
TLS_CACERT /etc/ssl/certs/ca-certificates.crt |
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,14 @@ | ||
SHELL=/bin/bash | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
MAILTO="" | ||
# Run Expiration Policies for CO 1 once a day at 1:00 AM | ||
0 1 * * * cd /srv/comanage-registry/app && ./Console/cake job CoreJob.Expire -s --coid 1 | ||
|
||
# Run Synchronize Org Identity Sources for CO 1 once a day at 1:00 AM | ||
0 1 * * * cd /srv/comanage-registry/app && ./Console/cake job CoreJob.Sync -s --coid 1 | ||
|
||
# Run Validate Group Member for CO 1 once a day at 1:00 AM | ||
0 1 * * * cd /srv/comanage-registry/app && ./Console/cake job CoreJob.ValidateGroupMember -s --coid 1 | ||
|
||
# Run queued jobs for CO 1 every 5 minutes | ||
0-59/5 * * * * cd /srv/comanage-registry/app && ./Console/cake job -q -r -c 1 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
# COmanage Registry Dockerfile entrypoint | ||
# | ||
# Portions licensed to the University Corporation for Advanced Internet | ||
# Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
# See the NOTICE file distributed with this work for additional information | ||
# regarding copyright ownership. | ||
# | ||
# UCAID licenses this file to you under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
source /usr/local/lib/comanage_utils.sh | ||
|
||
comanage_utils::exec_cron "$@" |
Large diffs are not rendered by default.
Oops, something went wrong.