From 252a3c8f59d6651705fcbbfd980b00d641a7c89d Mon Sep 17 00:00:00 2001 From: Chris Hubing Date: Fri, 8 Nov 2019 14:03:35 +0000 Subject: [PATCH] initial commit --- Dockerfile | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 58 +++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f289a96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,106 @@ +# 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 centos:centos7 AS php-build + +ARG PHP_VERSION=7.3.6 +ARG PHP_SRC_URL=https://github.com/php/php-src/archive/php-${PHP_VERSION}.tar.gz + +RUN yum -y install epel-release \ + && yum clean all + +RUN yum -y update \ + && yum -y install \ + autoconf \ + bison \ + gcc \ + httpd-devel \ + libargon2-devel \ + libcurl-devel \ + libedit-devel \ + libsodium-devel \ + libxml2-devel \ + libxslt-devel \ + make \ + mariadb-devel \ + openldap-devel \ + openssl-devel \ + postgresql-devel \ + re2c \ + wget \ + && yum clean all + +WORKDIR /usr/local/src + +RUN mkdir php-src \ + && wget -O php-src.tar.gz ${PHP_SRC_URL} \ + && tar zxf php-src.tar.gz -C php-src --strip-components=1 \ + && rm php-src.tar.gz + +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" + +RUN cd php-src \ + && ./buildconf --force \ + && ./configure \ + --disable-cgi \ + --enable-mbstring \ + --enable-mysqlnd \ + --with-apxs2=/usr/bin/apxs \ + --with-config-file-path=/usr/local/etc/php \ + --with-config-file-scan-dir=/usr/local/etc/php/conf.d \ + --with-curl \ + --with-ldap \ + --with-libdir=lib64 \ + --with-libedit \ + --with-mysqli \ + --with-openssl \ + --with-password-argon2 \ + --with-pdo-mysql \ + --with-pdo-pgsql \ + --with-pgsql \ + --with-sodium \ + --with-xsl \ + --with-zlib \ + && export CFLAGS="$PHP_CFLAGS" \ + && export CPPFLAGS="$PHP_CPPFLAGS" \ + && export LDFLAGS="$PHP_LDFLAGS" \ + && make -j "$(nproc)" \ + && make install + +RUN rm -rf php-src \ + && yum -y remove \ + autoconf \ + bison \ + gcc \ + httpd-devel \ + libargon2-devel \ + libcurl-devel \ + libedit-devel \ + libsodium-devel \ + libxml2-devel \ + libxslt-devel \ + make \ + mariadb-devel \ + openldap-devel \ + openssl-devel \ + postgresql-devel \ + re2c \ + wget \ + && yum clean all diff --git a/README.md b/README.md new file mode 100644 index 0000000..f468874 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ + + +# COmanage Registry Internet2 TIER Base Image + +Intended to build a COmanage Registry for Internet2 TIER base image +using CentOS 7 as the operating system and building PHP from source. + +By itself the image built from this Dockerfile does **not** provide +COmanage Registry. + +The image built from this Dockerfile is used as the base +for the Internet2 TIER image that includes COmanage Registry +with the Shibboleth Native SP for Apache HTTP Server (Shibboleth) +as the authentication mechanism. + +## Build Arguments + +No arguments are required for the build but the following argument +may be provided to override the default: + +``` +--build-arg PHP_VERSION= +``` + +## Building + +``` +docker build \ + -t comanage-registry-internet2-tier-base: . +``` + +## Building Example + +``` +export COMANAGE_REGISTRY_I2_BASE_IMAGE_VERSION=1 +TAG="${COMANAGE_REGISTRY_I2_BASE_IMAGE_VERSION}" +docker build \ + -t comanage-registry-internet2-tier-base:${TAG} . +```