Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
@Ioannis
Latest commit 790e103 Oct 10, 2024 History
3 contributors

Users who have contributed to this file

@skoranda @satkinson @Ioannis
124 lines (106 sloc) 4.71 KB
# COmanage Registry Dockerfile
#
# 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.
FROM php:8.2.24-apache-bookworm
# Official PHP image with Apache HTTPD includes
# --with-openssl
# --with-mbstring
# but xls, pdo, pdo_mysql, pdo_pgsql, mysqli, pgsql,
# and ldap extensions must be built.
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
libldap-2.5-0 \
libldap2-dev \
libmariadb-dev \
libpq-dev \
libxml2 \
libxslt1-dev \
libxslt1.1 \
ssl-cert \
wget \
zlib1g \
libpcre3-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-configure ldap --with-libdir=lib/$(uname -m)-linux-gnu \
&& docker-php-ext-configure mysqli \
&& docker-php-ext-install xsl pdo pdo_mysql pdo_pgsql mysqli pgsql ldap \
&& docker-php-source delete \
&& apt-get purge -y \
libldap2-dev \
libmysqlclient-dev \
libpq-dev \
&& apt-get clean
ARG COMANAGE_REGISTRY_VERSION
ENV COMANAGE_REGISTRY_VERSION ${COMANAGE_REGISTRY_VERSION:-develop}
LABEL comanage_registry_version=${COMANAGE_REGISTRY_VERSION}
ARG COMANAGE_REGISTRY_SRC_URL
ENV COMANAGE_REGISTRY_SRC_URL=${COMANAGE_REGISTRY_SRC_URL:-https://github.com/Internet2/comanage-registry/archive/${COMANAGE_REGISTRY_VERSION}.tar.gz}
ARG COMANAGE_REGISTRY_DIR
ENV COMANAGE_REGISTRY_DIR ${COMANAGE_REGISTRY_DIR:-/srv/comanage-registry}
LABEL comanage_registry_dir=${COMANAGE_REGISTRY_DIR}
RUN mkdir -p /tmp/build
COPY . /tmp/build
WORKDIR $COMANAGE_REGISTRY_DIR
RUN mkdir -p ${COMANAGE_REGISTRY_DIR} \
&& echo "Using COMANAGE_REGISTRY_SRC_URL ${COMANAGE_REGISTRY_SRC_URL}" \
&& curl -L -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 www-data:www-data ${COMANAGE_REGISTRY_DIR}/app/tmp \
&& cd /var/www/html \
&& ln -s ${COMANAGE_REGISTRY_DIR}/app/webroot registry \
&& chown -h www-data:www-data registry \
&& rm -rf ${COMANAGE_REGISTRY_DIR}/local/*
RUN rm -rf /tmp/build
ARG CACHEDIR
ENV CACHEDIR ${CACHEDIR:-/srv/comanage-registry/app/tmp/cache}
RUN a2enmod headers \
&& a2enmod ssl \
&& a2enmod rewrite \
&& a2dissite 000-default.conf \
&& a2disconf other-vhosts-access-log \
&& cd /etc/apache2 \
&& ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem cert.pem \
&& ln -s /etc/ssl/private/ssl-cert-snakeoil.key privkey.pem
COPY apache-include-directory-registry /etc/apache2/
COPY apache-include-virtual-host-port443-base /etc/apache2/
COPY apache-include-virtual-host-port80-redirect /etc/apache2/
COPY comanage_utils.sh /usr/local/lib/
COPY comanage_shibboleth_sp_utils.sh /usr/local/lib/
COPY docker-comanage-entrypoint /usr/local/bin/
EXPOSE 80 443
# Allow values for first administrator bootstrapped into the
# platform to be specified at image build time, in addition to
# being injected at run time through the entrypoint script.
ARG COMANAGE_REGISTRY_ADMIN_GIVEN_NAME
ARG COMANAGE_REGISTRY_ADMIN_FAMILY_NAME
ARG COMANAGE_REGISTRY_ADMIN_USERNAME
ARG COMANAGE_REGISTRY_ENABLE_POOLING
# Set simple defaults for first administrator bootstrapped into the
# platform to make simple evaluation of the platform easier.
ENV COMANAGE_REGISTRY_ADMIN_GIVEN_NAME ${COMANAGE_REGISTRY_ADMIN_GIVEN_NAME:-Registry}
ENV COMANAGE_REGISTRY_ADMIN_FAMILY_NAME ${COMANAGE_REGISTRY_ADMIN_FAMILY_NAME:-Admin}
ENV COMANAGE_REGISTRY_ADMIN_USERNAME ${COMANAGE_REGISTRY_ADMIN_USERNAME:-registry.admin}
ENV COMANAGE_REGISTRY_ENABLE_POOLING ${COMANAGE_REGISTRY_ENABLE_POOLING:-No}
# Configure LDAP client libraries for TLS
ENV LDAPTLS_CACERT /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT ["docker-comanage-entrypoint"]
CMD ["apache2-foreground"]