diff --git a/README.md b/README.md index a77ff88..68d5058 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,19 @@ ## Supported tags and respective `Dockerfile` links -- [`php55` (*php55/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php55/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php55.svg)](https://microbadger.com/images/outrigger/build:php55 "Get your own image badge on microbadger.com") -- [`php56` (*php56/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php56/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php56.svg)](https://microbadger.com/images/outrigger/build:php56 "Get your own image badge on microbadger.com") -- [`php70` (*php70/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php70/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php70.svg)](https://microbadger.com/images/outrigger/build:php70 "Get your own image badge on microbadger.com") -- [`php71` (*php71/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php71/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php71.svg)](https://microbadger.com/images/outrigger/build:php71 "Get your own image badge on microbadger.com") +- [`php55` (*php55/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php55/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php55.svg)](https://microbadger.com/images/outrigger/build:php55 "Get your own image badge on microbadger.com") +- [`php56` (*php56/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php56/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php56.svg)](https://microbadger.com/images/outrigger/build:php56 "Get your own image badge on microbadger.com") +- [`php70` (*php70/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php70/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php70.svg)](https://microbadger.com/images/outrigger/build:php70 "Get your own image badge on microbadger.com") +- [`php71` (*php71/Dockerfile*)](https://github.com/phase2/docker-build/blob/master/php71/Dockerfile) [![](https://images.microbadger.com/badges/image/outrigger/build:php71.svg)](https://microbadger.com/images/outrigger/build:php71 "Get your own image badge on microbadger.com") This image provides the many development tools necessary to build applications the Outrigger way, bundled with a wide array of tools useful for development and troubleshooting via the command-line interface. While it is possible to directly connect to the web containers, this is the preferred way to perform "server work". +The build images derive from [outrigger/keel](https://github.com/phase2/docker-keel), +our CLI workshop base image. + For more documentation on how Outrigger images are constructed and how to work with them, please [see the documentation](http://docs.outrigger.sh). @@ -48,9 +51,9 @@ file is written there. For example `/data/PROJECT/ENV/bash:/root/bash` ## Environment Variables -Outrigger images use Environment Variables and [confd](https://github.com/kelseyhightower/confd) to templatize a number -of Docker environment configurations. These templates are processed on startup with environment variables passed in -via the docker run command-line or via your `docker-compose.yml` manifest file. Here are the "tunable" configurations +Outrigger images use Environment Variables and [confd](https://github.com/kelseyhightower/confd) to templatize a number +of Docker environment configurations. These templates are processed on startup with environment variables passed in +via the docker run command-line or via your `docker-compose.yml` manifest file. Here are the "tunable" configurations offered by this image. * `NODE_VERSION`: [`4`|`6`|`8`] Defaults to 4. Selects the major version of Node diff --git a/php55/Dockerfile b/php55/Dockerfile index 4e2fe93..6cfc33d 100644 --- a/php55/Dockerfile +++ b/php55/Dockerfile @@ -1,15 +1,19 @@ -FROM centos:7 +FROM outrigger/keel:1.0 + +# Add Labels for differences from outrigger/keel. +# @see http://label-schema.org/rc1/ +# CentOS adds a name label but it is misleading in our instance. +LABEL \ + name="Outrigger Build (PHP)" \ + org.label-schema.name="Outrigger Build (PHP)" \ + org.label-schema.description="A CentOS-based image that facilitates interconnected build and operational tasks for PHP." \ + org.label-schema.vcs-url="https://github.com/phase2/docker-build" \ + org.label-schema.docker.cmd="docker run -it --rm outrigger/build:php55 bash" \ + org.label-schema.docker.cmd.help="docker run -it --rm outrigger/build:php55" # Install base packages. -RUN yum -y install epel-release centos-release-scl yum-plugin-ovl deltarpm && \ - yum -y update && \ - yum -y install sudo ssh curl less vim-minimal dnsutils openssl - -# Download confd. -ENV CONFD_VERSION 0.11.0 -RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \ - chmod +x /usr/bin/confd -ENV CONFD_OPTS '--backend=env --onetime' +RUN yum -y install centos-release-scl \ + && yum -y update RUN yum -y install \ https://www.softwarecollections.org/en/scls/remi/php55more/epel-7-x86_64/download/remi-php55more-epel-7-x86_64.noarch.rpm && \ @@ -17,10 +21,7 @@ RUN yum -y install \ RUN yum-config-manager --enable rhel-server-rhscl-7-rpms -# Add the IUS repository. This is needed for git2. -RUN curl -L "https://centos7.iuscommunity.org/ius-release.rpm" > /usr/local/ius-release.rpm && \ - rpm -Uvh /usr/local/ius-release.rpm - +# Install language runtimes and additional tools. RUN yum -y install \ # Install PHP php55 \ @@ -43,25 +44,15 @@ RUN yum -y install \ ruby193-rubygems \ ruby193-ruby-devel \ # Install Miscellaneous Tools - bzip2 \ gcc-c++ \ - git2u-all \ httpd-tools \ - jq \ - make \ mariadb \ nmap-ncat \ - patch \ - pv \ postgresql \ - rsync \ - sendmail \ - unzip \ - # Necessary for drush - which \ # Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904 fontconfig \ - && yum clean all + && yum clean all \ + && rm -rf /var/cache/yum # Ensure php55 and ruby193 binaries are in path ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @@ -77,10 +68,6 @@ ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig # Ensure $HOME is set ENV HOME /root -# Configure Git -# https://git-scm.com/docs/git-config#git-config-corepreloadIndex -RUN git config --global core.preloadindex true - # Install Composer RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser diff --git a/php55/root/etc/confd/conf.d/startuptime.toml b/php55/root/etc/confd/conf.d/startuptime.toml deleted file mode 100644 index 3d8a2a8..0000000 --- a/php55/root/etc/confd/conf.d/startuptime.toml +++ /dev/null @@ -1,6 +0,0 @@ -[template] -src="startuptime.tmpl" -dest="/var/log/services/README.txt" -keys=[ - "/", -] diff --git a/php55/root/etc/confd/templates/startuptime.tmpl b/php55/root/etc/confd/templates/startuptime.tmpl deleted file mode 100644 index 8749d2a..0000000 --- a/php55/root/etc/confd/templates/startuptime.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -This container was started at {{datetime}}. - -The logs for various services in the container will be written to this directory. diff --git a/php55/root/etc/profile.d/switch_bash_history.sh b/php55/root/etc/profile.d/switch_bash_history.sh deleted file mode 100644 index b56fd5c..0000000 --- a/php55/root/etc/profile.d/switch_bash_history.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# This script is intended to pair with a docker-compose volume line -# like /data/project_dir/bash:/root/bash to result in persistent -# project restricted bash history preservation between build container -# invocations - -TRIGGER_DIR=~/bash - -if [ -e $TRIGGER_DIR ]; then - if [ -e ~/.bash_history ]; then - rm -f ~/.bash_history - fi - ln -sf $TRIGGER_DIR/.bash_history ~/.bash_history -fi \ No newline at end of file diff --git a/php55/root/outrigger-key.sh b/php55/root/outrigger-key.sh deleted file mode 100755 index cbcffe4..0000000 --- a/php55/root/outrigger-key.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -KEY_BASE=/root/.ssh -KEY_FILE=$KEY_BASE/outrigger.key - -# First check to see if a volume mounted keyfile with a specific name exists. -# If the source on a bind mount does not exist it will be created as an empty directory. -if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] -then - - echo "KEY_FILE found. Setting up key..." - -else - - echo "##############################################################" - echo "Outrigger Private Key was not set. You will not be able to " - echo "clone private repositories. " - echo " " - echo "You can import a private key by volume mounting a key at " - echo " " - echo " $KEY_FILE" - echo " " - echo "##############################################################" - exit - -fi - -# Determine the proper name for the file based on key type -KEY_DATA="$(cat $KEY_FILE)" -if [[ "$KEY_DATA" =~ "BEGIN DSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_dsa" -elif [[ "$KEY_DATA" =~ "BEGIN RSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_rsa" -fi - -# Create the key file with the proper permissions -cp $KEY_FILE $PRIVATE_KEY -chown root:root $PRIVATE_KEY -chmod 600 $PRIVATE_KEY - -# Make sure that commands don't need to prompt for host keys -ssh-keyscan -H bitbucket.org 2>/dev/null >> $KEY_BASE/known_hosts -ssh-keyscan -H github.com 2>/dev/null >> $KEY_BASE/known_hosts diff --git a/php56/Dockerfile b/php56/Dockerfile index 0dd4459..db6a7cf 100644 --- a/php56/Dockerfile +++ b/php56/Dockerfile @@ -1,15 +1,19 @@ -FROM centos:7 +FROM outrigger/keel:1.0 + +# Add Labels for differences from outrigger/keel. +# @see http://label-schema.org/rc1/ +# CentOS adds a name label but it is misleading in our instance. +LABEL \ + name="Outrigger Build (PHP)" \ + org.label-schema.name="Outrigger Build (PHP)" \ + org.label-schema.description="A CentOS-based image that facilitates interconnected build and operational tasks for PHP." \ + org.label-schema.vcs-url="https://github.com/phase2/docker-build" \ + org.label-schema.docker.cmd="docker run -it --rm outrigger/build:php56 bash" \ + org.label-schema.docker.cmd.help="docker run -it --rm outrigger/build:php56" # Install base packages. -RUN yum -y install epel-release yum-plugin-ovl deltarpm && \ - yum -y update && \ - yum -y install sudo ssh curl less vim-minimal dnsutils openssl - -# Download confd. -ENV CONFD_VERSION 0.11.0 -RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \ - chmod +x /usr/bin/confd -ENV CONFD_OPTS '--backend=env --onetime' +RUN yum -y install epel-release yum-plugin-ovl deltarpm \ + && yum -y update RUN yum -y install \ centos-release-scl-rh \ @@ -18,10 +22,7 @@ RUN yum -y install \ https://www.softwarecollections.org/en/scls/rhscl/v8314/epel-7-x86_64/download/rhscl-v8314-epel-7-x86_64.noarch.rpm && \ yum -y update -# Add the IUS repository. This is needed for git2. -RUN curl -L "https://centos7.iuscommunity.org/ius-release.rpm" > /usr/local/ius-release.rpm && \ - rpm -Uvh /usr/local/ius-release.rpm - +# Install language runtimes and additional tools. RUN yum -y install \ # Install PHP rh-php56 \ @@ -42,25 +43,15 @@ RUN yum -y install \ ruby193-rubygems \ ruby193-ruby-devel \ # Install Miscellaneous Tools - bzip2 \ gcc-c++ \ - git2u-all \ httpd-tools \ - jq \ - make \ mariadb \ nmap-ncat \ - patch \ postgresql \ - pv \ - rsync \ - sendmail \ - unzip \ - # Necessary for drush - which \ # Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904 fontconfig \ - && yum clean all + && yum clean all \ + && rm -rf /var/cache/yum # Ensure ruby193 binaries are in path ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @@ -87,10 +78,6 @@ ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig # Ensure $HOME is set ENV HOME /root -# Configure Git -# https://git-scm.com/docs/git-config#git-config-corepreloadIndex -RUN git config --global core.preloadindex true - # Install Composer RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser diff --git a/php56/root/etc/confd/conf.d/startuptime.toml b/php56/root/etc/confd/conf.d/startuptime.toml deleted file mode 100644 index 3d8a2a8..0000000 --- a/php56/root/etc/confd/conf.d/startuptime.toml +++ /dev/null @@ -1,6 +0,0 @@ -[template] -src="startuptime.tmpl" -dest="/var/log/services/README.txt" -keys=[ - "/", -] diff --git a/php56/root/etc/confd/templates/startuptime.tmpl b/php56/root/etc/confd/templates/startuptime.tmpl deleted file mode 100644 index 8749d2a..0000000 --- a/php56/root/etc/confd/templates/startuptime.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -This container was started at {{datetime}}. - -The logs for various services in the container will be written to this directory. diff --git a/php56/root/etc/profile.d/switch_bash_history.sh b/php56/root/etc/profile.d/switch_bash_history.sh deleted file mode 100644 index b56fd5c..0000000 --- a/php56/root/etc/profile.d/switch_bash_history.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# This script is intended to pair with a docker-compose volume line -# like /data/project_dir/bash:/root/bash to result in persistent -# project restricted bash history preservation between build container -# invocations - -TRIGGER_DIR=~/bash - -if [ -e $TRIGGER_DIR ]; then - if [ -e ~/.bash_history ]; then - rm -f ~/.bash_history - fi - ln -sf $TRIGGER_DIR/.bash_history ~/.bash_history -fi \ No newline at end of file diff --git a/php56/root/outrigger-key.sh b/php56/root/outrigger-key.sh deleted file mode 100755 index cbcffe4..0000000 --- a/php56/root/outrigger-key.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -KEY_BASE=/root/.ssh -KEY_FILE=$KEY_BASE/outrigger.key - -# First check to see if a volume mounted keyfile with a specific name exists. -# If the source on a bind mount does not exist it will be created as an empty directory. -if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] -then - - echo "KEY_FILE found. Setting up key..." - -else - - echo "##############################################################" - echo "Outrigger Private Key was not set. You will not be able to " - echo "clone private repositories. " - echo " " - echo "You can import a private key by volume mounting a key at " - echo " " - echo " $KEY_FILE" - echo " " - echo "##############################################################" - exit - -fi - -# Determine the proper name for the file based on key type -KEY_DATA="$(cat $KEY_FILE)" -if [[ "$KEY_DATA" =~ "BEGIN DSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_dsa" -elif [[ "$KEY_DATA" =~ "BEGIN RSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_rsa" -fi - -# Create the key file with the proper permissions -cp $KEY_FILE $PRIVATE_KEY -chown root:root $PRIVATE_KEY -chmod 600 $PRIVATE_KEY - -# Make sure that commands don't need to prompt for host keys -ssh-keyscan -H bitbucket.org 2>/dev/null >> $KEY_BASE/known_hosts -ssh-keyscan -H github.com 2>/dev/null >> $KEY_BASE/known_hosts diff --git a/php70/Dockerfile b/php70/Dockerfile index 61b16f0..1d81ceb 100644 --- a/php70/Dockerfile +++ b/php70/Dockerfile @@ -1,26 +1,27 @@ -FROM centos:7 +FROM outrigger/keel:1.0 + +# Add Labels for differences from outrigger/keel. +# @see http://label-schema.org/rc1/ +# CentOS adds a name label but it is misleading in our instance. +LABEL \ + name="Outrigger Build (PHP)" \ + org.label-schema.name="Outrigger Build (PHP)" \ + org.label-schema.description="A CentOS-based image that facilitates interconnected build and operational tasks for PHP." \ + org.label-schema.vcs-url="https://github.com/phase2/docker-build" \ + org.label-schema.docker.cmd="docker run -it --rm outrigger/build:php70 bash" \ + org.label-schema.docker.cmd.help="docker run -it --rm outrigger/build:php70" # Install base packages. -RUN yum -y install epel-release centos-release-scl yum-plugin-ovl deltarpm && \ - yum -y update && \ - yum -y install sudo ssh curl less vim-minimal dnsutils openssl +RUN yum -y install centos-release-scl \ + && yum -y update RUN yum-config-manager --enable rhel-server-rhscl-7-rpms -# Download confd. -ENV CONFD_VERSION 0.11.0 -RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \ - chmod +x /usr/bin/confd -ENV CONFD_OPTS '--backend=env --onetime' - RUN yum -y install \ https://rpms.remirepo.net/enterprise/remi-release-7.rpm \ - yum -y update - -# Add the IUS repository. This is needed for git2. -RUN curl -L "https://centos7.iuscommunity.org/ius-release.rpm" > /usr/local/ius-release.rpm && \ - rpm -Uvh /usr/local/ius-release.rpm + && yum -y update +# Install language runtimes and additional tools. RUN yum -y install \ # Install PHP php70 \ @@ -42,25 +43,15 @@ RUN yum -y install \ ruby193-rubygems \ ruby193-ruby-devel \ # Install Miscellaneous Tools - bzip2 \ gcc-c++ \ - git2u-all \ httpd-tools \ - jq \ - make \ mariadb \ nmap-ncat \ - patch \ postgresql \ - pv \ - rsync \ - sendmail \ - unzip \ - # Necessary for drush - which \ # Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904 fontconfig \ - && yum clean all + && yum clean all \ + && rm -rf /var/cache/yum # Ensure ruby193 binaries are in path ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @@ -87,10 +78,6 @@ ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig # Ensure $HOME is set ENV HOME /root -# Configure Git -# https://git-scm.com/docs/git-config#git-config-corepreloadIndex -RUN git config --global core.preloadindex true - # Install Composer RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser @@ -138,10 +125,4 @@ COPY root / # Install Drush commands RUN drush pm-download -yv registry_rebuild-7.x --destination=/etc/drush/commands -# Run the s6-based init. -ENTRYPOINT ["/init"] - -# Set up a standard volume for logs. -VOLUME ["/var/log/services"] - CMD [ "/versions.sh" ] diff --git a/php70/root/etc/confd/conf.d/startuptime.toml b/php70/root/etc/confd/conf.d/startuptime.toml deleted file mode 100644 index 3d8a2a8..0000000 --- a/php70/root/etc/confd/conf.d/startuptime.toml +++ /dev/null @@ -1,6 +0,0 @@ -[template] -src="startuptime.tmpl" -dest="/var/log/services/README.txt" -keys=[ - "/", -] diff --git a/php70/root/etc/confd/templates/startuptime.tmpl b/php70/root/etc/confd/templates/startuptime.tmpl deleted file mode 100644 index 8749d2a..0000000 --- a/php70/root/etc/confd/templates/startuptime.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -This container was started at {{datetime}}. - -The logs for various services in the container will be written to this directory. diff --git a/php70/root/etc/profile.d/switch_bash_history.sh b/php70/root/etc/profile.d/switch_bash_history.sh deleted file mode 100755 index b56fd5c..0000000 --- a/php70/root/etc/profile.d/switch_bash_history.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# This script is intended to pair with a docker-compose volume line -# like /data/project_dir/bash:/root/bash to result in persistent -# project restricted bash history preservation between build container -# invocations - -TRIGGER_DIR=~/bash - -if [ -e $TRIGGER_DIR ]; then - if [ -e ~/.bash_history ]; then - rm -f ~/.bash_history - fi - ln -sf $TRIGGER_DIR/.bash_history ~/.bash_history -fi \ No newline at end of file diff --git a/php70/root/outrigger-key.sh b/php70/root/outrigger-key.sh deleted file mode 100755 index cbcffe4..0000000 --- a/php70/root/outrigger-key.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -KEY_BASE=/root/.ssh -KEY_FILE=$KEY_BASE/outrigger.key - -# First check to see if a volume mounted keyfile with a specific name exists. -# If the source on a bind mount does not exist it will be created as an empty directory. -if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] -then - - echo "KEY_FILE found. Setting up key..." - -else - - echo "##############################################################" - echo "Outrigger Private Key was not set. You will not be able to " - echo "clone private repositories. " - echo " " - echo "You can import a private key by volume mounting a key at " - echo " " - echo " $KEY_FILE" - echo " " - echo "##############################################################" - exit - -fi - -# Determine the proper name for the file based on key type -KEY_DATA="$(cat $KEY_FILE)" -if [[ "$KEY_DATA" =~ "BEGIN DSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_dsa" -elif [[ "$KEY_DATA" =~ "BEGIN RSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_rsa" -fi - -# Create the key file with the proper permissions -cp $KEY_FILE $PRIVATE_KEY -chown root:root $PRIVATE_KEY -chmod 600 $PRIVATE_KEY - -# Make sure that commands don't need to prompt for host keys -ssh-keyscan -H bitbucket.org 2>/dev/null >> $KEY_BASE/known_hosts -ssh-keyscan -H github.com 2>/dev/null >> $KEY_BASE/known_hosts diff --git a/php71/Dockerfile b/php71/Dockerfile index af3c099..e14401e 100644 --- a/php71/Dockerfile +++ b/php71/Dockerfile @@ -1,26 +1,27 @@ -FROM centos:7 +FROM outrigger/keel:1.0 + +# Add Labels for differences from outrigger/keel. +# @see http://label-schema.org/rc1/ +# CentOS adds a name label but it is misleading in our instance. +LABEL \ + name="Outrigger Build (PHP)" \ + org.label-schema.name="Outrigger Build (PHP)" \ + org.label-schema.description="A CentOS-based image that facilitates interconnected build and operational tasks for PHP." \ + org.label-schema.vcs-url="https://github.com/phase2/docker-build" \ + org.label-schema.docker.cmd="docker run -it --rm outrigger/build:php71 bash" \ + org.label-schema.docker.cmd.help="docker run -it --rm outrigger/build:php71" # Install base packages. -RUN yum -y install epel-release centos-release-scl yum-plugin-ovl deltarpm && \ - yum -y update && \ - yum -y install sudo ssh curl less vim-minimal dnsutils openssl +RUN yum -y install centos-release-scl \ + && yum -y update RUN yum-config-manager --enable rhel-server-rhscl-7-rpms -# Download confd. -ENV CONFD_VERSION 0.11.0 -RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \ - chmod +x /usr/bin/confd -ENV CONFD_OPTS '--backend=env --onetime' - RUN yum -y install \ https://rpms.remirepo.net/enterprise/remi-release-7.rpm \ - yum -y update - -# Add the IUS repository. This is needed for git2. -RUN curl -L "https://centos7.iuscommunity.org/ius-release.rpm" > /usr/local/ius-release.rpm && \ - rpm -Uvh /usr/local/ius-release.rpm + && yum -y update +# Install language runtimes and additional tools. RUN yum -y install \ # Install PHP php71 \ @@ -42,25 +43,15 @@ RUN yum -y install \ ruby193-rubygems \ ruby193-ruby-devel \ # Install Miscellaneous Tools - bzip2 \ gcc-c++ \ - git2u-all \ httpd-tools \ - jq \ - make \ mariadb \ nmap-ncat \ - patch \ postgresql \ - pv \ - rsync \ - sendmail \ - unzip \ - # Necessary for drush - which \ # Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904 fontconfig \ - && yum clean all + && yum clean all \ + && rm -rf /var/cache/yum # Ensure ruby193 binaries are in path ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @@ -87,10 +78,6 @@ ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig # Ensure $HOME is set ENV HOME /root -# Configure Git -# https://git-scm.com/docs/git-config#git-config-corepreloadIndex -RUN git config --global core.preloadindex true - # Install Composer RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser diff --git a/php71/root/etc/confd/conf.d/startuptime.toml b/php71/root/etc/confd/conf.d/startuptime.toml deleted file mode 100644 index 3d8a2a8..0000000 --- a/php71/root/etc/confd/conf.d/startuptime.toml +++ /dev/null @@ -1,6 +0,0 @@ -[template] -src="startuptime.tmpl" -dest="/var/log/services/README.txt" -keys=[ - "/", -] diff --git a/php71/root/etc/confd/templates/startuptime.tmpl b/php71/root/etc/confd/templates/startuptime.tmpl deleted file mode 100644 index 8749d2a..0000000 --- a/php71/root/etc/confd/templates/startuptime.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -This container was started at {{datetime}}. - -The logs for various services in the container will be written to this directory. diff --git a/php71/root/etc/profile.d/switch_bash_history.sh b/php71/root/etc/profile.d/switch_bash_history.sh deleted file mode 100644 index b56fd5c..0000000 --- a/php71/root/etc/profile.d/switch_bash_history.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# This script is intended to pair with a docker-compose volume line -# like /data/project_dir/bash:/root/bash to result in persistent -# project restricted bash history preservation between build container -# invocations - -TRIGGER_DIR=~/bash - -if [ -e $TRIGGER_DIR ]; then - if [ -e ~/.bash_history ]; then - rm -f ~/.bash_history - fi - ln -sf $TRIGGER_DIR/.bash_history ~/.bash_history -fi \ No newline at end of file diff --git a/php71/root/outrigger-key.sh b/php71/root/outrigger-key.sh deleted file mode 100755 index cbcffe4..0000000 --- a/php71/root/outrigger-key.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -KEY_BASE=/root/.ssh -KEY_FILE=$KEY_BASE/outrigger.key - -# First check to see if a volume mounted keyfile with a specific name exists. -# If the source on a bind mount does not exist it will be created as an empty directory. -if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] -then - - echo "KEY_FILE found. Setting up key..." - -else - - echo "##############################################################" - echo "Outrigger Private Key was not set. You will not be able to " - echo "clone private repositories. " - echo " " - echo "You can import a private key by volume mounting a key at " - echo " " - echo " $KEY_FILE" - echo " " - echo "##############################################################" - exit - -fi - -# Determine the proper name for the file based on key type -KEY_DATA="$(cat $KEY_FILE)" -if [[ "$KEY_DATA" =~ "BEGIN DSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_dsa" -elif [[ "$KEY_DATA" =~ "BEGIN RSA" ]]; then - PRIVATE_KEY="$KEY_BASE/id_rsa" -fi - -# Create the key file with the proper permissions -cp $KEY_FILE $PRIVATE_KEY -chown root:root $PRIVATE_KEY -chmod 600 $PRIVATE_KEY - -# Make sure that commands don't need to prompt for host keys -ssh-keyscan -H bitbucket.org 2>/dev/null >> $KEY_BASE/known_hosts -ssh-keyscan -H github.com 2>/dev/null >> $KEY_BASE/known_hosts