diff --git a/buildspec.yml b/buildspec.yml index 822a5ee2..585491d0 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -33,5 +33,13 @@ phases: - docker build -t aws/codebuild/ruby:2.2.5 . - cd $CODEBUILD_SRC_DIR/ubuntu/ruby/2.3.1 - docker build -t aws/codebuild/ruby:2.3.1 . + - cd $CODEBUILD_SRC_DIR/ubuntu/golang/1.10 + - docker build -t aws/codebuild/golang:1.10 . + - cd $CODEBUILD_SRC_DIR/ubuntu/java/openjdk-9 + - docker build -t aws/codebuild/java:openjdk-9 . + - cd $CODEBUILD_SRC_DIR/ubuntu/php/5.6 + - docker build -t aws/codebuild/php:5.6 . + - cd $CODEBUILD_SRC_DIR/ubuntu/php/7.0 + - docker build -t aws/codebuild/php:7.0 . - cd $CODEBUILD_SRC_DIR/ubuntu/ubuntu-base/14.04 - docker build -t aws/codebuild/ubuntu-base:14.04 . diff --git a/ubuntu/android-java-8/24.4.1/Dockerfile b/ubuntu/android-java-8/24.4.1/Dockerfile index c60d3872..559b1502 100644 --- a/ubuntu/android-java-8/24.4.1/Dockerfile +++ b/ubuntu/android-java-8/24.4.1/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/docker/17.09.0/Dockerfile b/ubuntu/docker/17.09.0/Dockerfile index bdbce54e..58cc8d58 100644 --- a/ubuntu/docker/17.09.0/Dockerfile +++ b/ubuntu/docker/17.09.0/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/dot-net/core-1/Dockerfile b/ubuntu/dot-net/core-1/Dockerfile index faaa2dce..2ad3e1a5 100644 --- a/ubuntu/dot-net/core-1/Dockerfile +++ b/ubuntu/dot-net/core-1/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/dot-net/core-2/Dockerfile b/ubuntu/dot-net/core-2/Dockerfile index e42c5535..84e568c3 100644 --- a/ubuntu/dot-net/core-2/Dockerfile +++ b/ubuntu/dot-net/core-2/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/golang/1.10/Dockerfile b/ubuntu/golang/1.10/Dockerfile new file mode 100644 index 00000000..eaebdf2a --- /dev/null +++ b/ubuntu/golang/1.10/Dockerfile @@ -0,0 +1,107 @@ +# Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/asl/ +# +# or in the "license" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +# + +FROM ubuntu:14.04.5 + +ENV DOCKER_BUCKET="download.docker.com" \ + DOCKER_VERSION="17.09.0-ce" \ + DOCKER_CHANNEL="stable" \ + DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \ + DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \ + DOCKER_COMPOSE_VERSION="1.16.1" + +# Building git from source code: +# Ubuntu's default git package is built with broken gnutls. Rebuild git with openssl. +########################################################################## +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates \ + tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-* \ + bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-* \ + libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~* \ + libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-* \ + libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-* \ + libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-* \ + libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.21-* libreadline-dev=6.3-* \ + libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-* \ + libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-* \ + patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-* \ + e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-* \ + && apt-get install -y -qq less=458-* groff=1.22.2-* \ + && apt-get -qy build-dep git=1:1.9.1 \ + && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-* \ + && mkdir -p /usr/src/git-openssl \ + && cd /usr/src/git-openssl \ + && apt-get source git=1:1.9.1 \ + && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*") \ + && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control \ + && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules \ + && dpkg-buildpackage -rfakeroot -b \ + && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \; \ + && rm -rf /usr/src/git-openssl \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean + +# Install Docker +RUN set -x \ + && curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ + && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ + && tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \ + && rm docker.tgz \ + && docker -v \ +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box + && addgroup dockremap \ + && useradd -g dockremap dockremap \ + && echo 'dockremap:165536:65536' >> /etc/subuid \ + && echo 'dockremap:165536:65536' >> /etc/subgid \ + && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ + && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \ +# Ensure docker-compose works + && docker-compose version + +# Install dependencies by all python images equivalent to buildpack-deps:jessie +# on the public repos. + +RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ + && python /tmp/get-pip.py \ + && pip install awscli \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + +VOLUME /var/lib/docker + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["dockerd-entrypoint.sh"] + + +ENV GOLANG_VERSION="1.10" \ + GOLANG_DOWNLOAD_SHA256="b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33" \ + GOPATH="/go" \ + DEP_VERSION="0.4.1" \ + DEP_BINARY="dep-linux-amd64" + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \ + && chmod -R 777 "$GOPATH" \ + && apt-get update && apt-get install -y --no-install-recommends \ + pkg-config=0.26-* \ + && apt-get clean \ + && wget "https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz" -O /tmp/golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 /tmp/golang.tar.gz" | sha256sum -c - \ + && tar -xzf /tmp/golang.tar.gz -C /usr/local \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && wget "https://github.com/golang/dep/releases/download/v$DEP_VERSION/$DEP_BINARY" -O "$GOPATH/bin/dep" + +ENV PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" +WORKDIR $GOPATH + +ENTRYPOINT ["dockerd-entrypoint.sh"] diff --git a/ubuntu/golang/1.10/dockerd-entrypoint.sh b/ubuntu/golang/1.10/dockerd-entrypoint.sh new file mode 100755 index 00000000..7af585c1 --- /dev/null +++ b/ubuntu/golang/1.10/dockerd-entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +/usr/local/bin/dockerd \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=overlay &>/var/log/docker.log & + + +tries=0 +d_timeout=60 +until docker info >/dev/null 2>&1 +do + if [ "$tries" -gt "$d_timeout" ]; then + cat /var/log/docker.log + echo 'Timed out trying to connect to internal docker host.' >&2 + exit 1 + fi + tries=$(( $tries + 1 )) + sleep 1 +done + +eval "$@" diff --git a/ubuntu/golang/1.7.3/Dockerfile b/ubuntu/golang/1.7.3/Dockerfile index 2b259073..b72be476 100644 --- a/ubuntu/golang/1.7.3/Dockerfile +++ b/ubuntu/golang/1.7.3/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker @@ -86,7 +86,9 @@ ENTRYPOINT ["dockerd-entrypoint.sh"] ENV GOLANG_VERSION="1.7.3" \ GOLANG_DOWNLOAD_SHA256="508028aac0654e993564b6e2014bf2d4a9751e3b286661b0b0040046cf18028e" \ - GOPATH="/go" + GOPATH="/go" \ + DEP_VERSION="0.4.1" \ + DEP_BINARY="dep-linux-amd64" RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \ && chmod -R 777 "$GOPATH" \ @@ -96,10 +98,10 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \ && wget "https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz" -O /tmp/golang.tar.gz \ && echo "$GOLANG_DOWNLOAD_SHA256 /tmp/golang.tar.gz" | sha256sum -c - \ && tar -xzf /tmp/golang.tar.gz -C /usr/local \ - && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && wget "https://github.com/golang/dep/releases/download/v$DEP_VERSION/$DEP_BINARY" -O "$GOPATH/bin/dep" ENV PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" - WORKDIR $GOPATH ENTRYPOINT ["dockerd-entrypoint.sh"] diff --git a/ubuntu/java/openjdk-8/Dockerfile b/ubuntu/java/openjdk-8/Dockerfile index c237331f..ee298398 100644 --- a/ubuntu/java/openjdk-8/Dockerfile +++ b/ubuntu/java/openjdk-8/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/java/openjdk-8/m2-settings.xml b/ubuntu/java/openjdk-8/m2-settings.xml index 7bc5cecc..ce4b25dd 100644 --- a/ubuntu/java/openjdk-8/m2-settings.xml +++ b/ubuntu/java/openjdk-8/m2-settings.xml @@ -1,11 +1,10 @@ - - - securecentral - securecentral + + true + diff --git a/ubuntu/java/openjdk-9/Dockerfile b/ubuntu/java/openjdk-9/Dockerfile new file mode 100644 index 00000000..47136a91 --- /dev/null +++ b/ubuntu/java/openjdk-9/Dockerfile @@ -0,0 +1,164 @@ +# Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/asl/ +# +# or in the "license" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +# + +FROM ubuntu:14.04.5 + +ENV DOCKER_BUCKET="download.docker.com" \ + DOCKER_VERSION="17.09.0-ce" \ + DOCKER_CHANNEL="stable" \ + DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \ + DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \ + DOCKER_COMPOSE_VERSION="1.16.1" + +# Building git from source code: +# Ubuntu's default git package is built with broken gnutls. Rebuild git with openssl. +########################################################################## +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates \ + tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-* \ + bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-* \ + libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~* \ + libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-* \ + libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-* \ + libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-* \ + libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.21-* libreadline-dev=6.3-* \ + libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-* \ + libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-* \ + patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-* \ + e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-* \ + && apt-get install -y -qq less=458-* groff=1.22.2-* \ + && apt-get -qy build-dep git=1:1.9.1 \ + && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-* \ + && mkdir -p /usr/src/git-openssl \ + && cd /usr/src/git-openssl \ + && apt-get source git=1:1.9.1 \ + && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*") \ + && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control \ + && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules \ + && dpkg-buildpackage -rfakeroot -b \ + && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \; \ + && rm -rf /usr/src/git-openssl \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean + +# Install Docker +RUN set -x \ + && curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ + && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ + && tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \ + && rm docker.tgz \ + && docker -v \ +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box + && addgroup dockremap \ + && useradd -g dockremap dockremap \ + && echo 'dockremap:165536:65536' >> /etc/subuid \ + && echo 'dockremap:165536:65536' >> /etc/subgid \ + && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ + && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \ +# Ensure docker-compose works + && docker-compose version + +# Install dependencies by all python images equivalent to buildpack-deps:jessie +# on the public repos. + +RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ + && python /tmp/get-pip.py \ + && pip install awscli \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + +VOLUME /var/lib/docker + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["dockerd-entrypoint.sh"] + + +ENV JAVA_VERSION=9 \ + JAVA_HOME="/opt/jvm/openjdk-9" \ + JDK_HOME="/opt/jvm/openjdk-9" \ + JRE_HOME="/opt/jvm/openjdk-9" \ + ANT_VERSION=1.10.2 \ + MAVEN_HOME="/opt/maven" \ + MAVEN_VERSION=3.5.2 \ + MAVEN_CONFIG="/root/.m2" \ + GRADLE_VERSION=4.2.1 \ + SBT_VERSION=1.0.3 \ + PROPERTIES_COMMON_VERSION=0.92.37.8 \ + PYTHON_TOOL_VERSION="3.3-*" \ + JDK_VERSION=9.0.4 \ + JDK_DOWNLOAD_SHA256="39362fb9bfb341fcc802e55e8ea59f4664ca58fd821ce956d48e1aa4fb3d2dec" \ + ANT_DOWNLOAD_SHA512="54805d9b263c3df3552fa4f9221483fc58ebebdbbdb2c34c97b8b13f41290cf9c23f54188a231eb6f3ac9588d618fc74ae0bde35ff80404e00479f1b08555417" \ + MAVEN_DOWNLOAD_SHA1="190dcebb8a080f983af4420cac4f3ece7a47dd64" \ + GRADLE_DOWNLOAD_SHA256="b551cc04f2ca51c78dd14edb060621f0e5439bdfafa6fd167032a09ac708fbc0" + +ENV JDK_DOWNLOAD_TAR="openjdk-${JDK_VERSION}_linux-x64_bin.tar.gz" + +RUN apt-get update \ + && apt-get install -y software-properties-common=$PROPERTIES_COMMON_VERSION \ + && apt-get -y install python-setuptools=$PYTHON_TOOL_VERSION \ + + # Install OpenJDK 9 + # Note: Installing ca-certificates-java installs JDK7 because it's a depedency. + # We will use update-alternatives to make sure JDK9 has higher priority for all + # the tools + && apt-get install -y ca-certificates-java \ + + && mkdir -p $JAVA_HOME \ + && curl -LSso /var/tmp/$JDK_DOWNLOAD_TAR https://download.java.net/java/GA/jdk9/$JDK_VERSION/binaries/$JDK_DOWNLOAD_TAR \ + && echo "$JDK_DOWNLOAD_SHA256 /var/tmp/$JDK_DOWNLOAD_TAR" | tee foo.txt | sha256sum -c - \ + && tar xzvf /var/tmp/$JDK_DOWNLOAD_TAR -C $JAVA_HOME --strip-components=1 \ + && for tool_path in $JAVA_HOME/bin/*; do \ + tool=`basename $tool_path`; \ + update-alternatives --install /usr/bin/$tool $tool $tool_path 10000; \ + update-alternatives --set $tool $tool_path; \ + done \ + && rm $JAVA_HOME/lib/security/cacerts && ln -s /etc/ssl/certs/java/cacerts $JAVA_HOME/lib/security/cacerts \ + + # Install Ant + && curl -LSso /var/tmp/apache-ant-$ANT_VERSION-bin.tar.gz https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz \ + && echo "$ANT_DOWNLOAD_SHA512 /var/tmp/apache-ant-$ANT_VERSION-bin.tar.gz" | sha512sum -c - \ + && tar -xzf /var/tmp/apache-ant-$ANT_VERSION-bin.tar.gz -C /opt \ + && update-alternatives --install /usr/bin/ant ant /opt/apache-ant-$ANT_VERSION/bin/ant 10000 \ + + # Install Maven + && mkdir -p $MAVEN_HOME \ + && curl -LSso /var/tmp/apache-maven-$MAVEN_VERSION-bin.tar.gz https://apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \ + && echo "$MAVEN_DOWNLOAD_SHA1 /var/tmp/apache-maven-$MAVEN_VERSION-bin.tar.gz" | sha1sum -c - \ + && tar xzvf /var/tmp/apache-maven-$MAVEN_VERSION-bin.tar.gz -C $MAVEN_HOME --strip-components=1 \ + && update-alternatives --install /usr/bin/mvn mvn /opt/maven/bin/mvn 10000 \ + && mkdir -p $MAVEN_CONFIG \ + + # Install Gradle + && curl -LSso /var/tmp/gradle-$GRADLE_VERSION-bin.zip https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip \ + && echo "$GRADLE_DOWNLOAD_SHA256 /var/tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c - \ + && unzip /var/tmp/gradle-$GRADLE_VERSION-bin.zip -d /opt \ + && update-alternatives --install /usr/local/bin/gradle gradle /opt/gradle-$GRADLE_VERSION/bin/gradle 10000 \ + + # Install SBT + && curl -LSso /var/tmp/sbt-$SBT_VERSION.tgz https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz \ + && curl -LSso /var/tmp/sbt-$SBT_VERSION.tgz.asc https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz.asc \ + && curl -LSso /var/tmp/sbt.key.asc https://bintray.com/user/downloadSubjectPublicKey?username=sbt \ + + && gpg --no-default-keyring --keyring /var/tmp/tmp-keyring.gpg --import /var/tmp/sbt.key.asc \ + && gpg --no-default-keyring --keyring /var/tmp/tmp-keyring.gpg --verify /var/tmp/sbt-$SBT_VERSION.tgz.asc /var/tmp/sbt-$SBT_VERSION.tgz \ + + && tar xzvf /var/tmp/sbt-$SBT_VERSION.tgz -C /opt && update-alternatives --install /usr/local/bin/sbt sbt /opt/sbt/bin/sbt 10000 \ + + # Cleanup + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && apt-get clean + +COPY m2-settings.xml $MAVEN_CONFIG/settings.xml + +ENTRYPOINT ["dockerd-entrypoint.sh"] diff --git a/ubuntu/java/openjdk-9/dockerd-entrypoint.sh b/ubuntu/java/openjdk-9/dockerd-entrypoint.sh new file mode 100755 index 00000000..7af585c1 --- /dev/null +++ b/ubuntu/java/openjdk-9/dockerd-entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +/usr/local/bin/dockerd \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=overlay &>/var/log/docker.log & + + +tries=0 +d_timeout=60 +until docker info >/dev/null 2>&1 +do + if [ "$tries" -gt "$d_timeout" ]; then + cat /var/log/docker.log + echo 'Timed out trying to connect to internal docker host.' >&2 + exit 1 + fi + tries=$(( $tries + 1 )) + sleep 1 +done + +eval "$@" diff --git a/ubuntu/java/openjdk-9/m2-settings.xml b/ubuntu/java/openjdk-9/m2-settings.xml new file mode 100644 index 00000000..ce4b25dd --- /dev/null +++ b/ubuntu/java/openjdk-9/m2-settings.xml @@ -0,0 +1,30 @@ + + + + securecentral + + true + + + + + central + https://repo1.maven.org/maven2 + + true + + + + + + central + https://repo1.maven.org/maven2 + + true + + + + + + diff --git a/ubuntu/nodejs/4.3.2/Dockerfile b/ubuntu/nodejs/4.3.2/Dockerfile index 49c0cb10..c2704f15 100644 --- a/ubuntu/nodejs/4.3.2/Dockerfile +++ b/ubuntu/nodejs/4.3.2/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/nodejs/4.4.7/Dockerfile b/ubuntu/nodejs/4.4.7/Dockerfile index a288c71d..084aaf63 100644 --- a/ubuntu/nodejs/4.4.7/Dockerfile +++ b/ubuntu/nodejs/4.4.7/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/nodejs/6.3.1/Dockerfile b/ubuntu/nodejs/6.3.1/Dockerfile index b8067ae1..def17ae1 100644 --- a/ubuntu/nodejs/6.3.1/Dockerfile +++ b/ubuntu/nodejs/6.3.1/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/php/5.6/Dockerfile b/ubuntu/php/5.6/Dockerfile new file mode 100644 index 00000000..bdd1a069 --- /dev/null +++ b/ubuntu/php/5.6/Dockerfile @@ -0,0 +1,198 @@ +# Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/asl/ +# +# or in the "license" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +# + +FROM ubuntu:14.04.5 + +ENV DOCKER_BUCKET="download.docker.com" \ + DOCKER_VERSION="17.09.0-ce" \ + DOCKER_CHANNEL="stable" \ + DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \ + DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \ + DOCKER_COMPOSE_VERSION="1.16.1" + +# Building git from source code: +# Ubuntu's default git package is built with broken gnutls. Rebuild git with openssl. +########################################################################## +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates \ + tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-* \ + bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-* \ + libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~* \ + libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-* \ + libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-* \ + libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-* \ + libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.21-* libreadline-dev=6.3-* \ + libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-* \ + libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-* \ + patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-* \ + e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-* \ + && apt-get install -y -qq less=458-* groff=1.22.2-* \ + && apt-get -qy build-dep git=1:1.9.1 \ + && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-* \ + && mkdir -p /usr/src/git-openssl \ + && cd /usr/src/git-openssl \ + && apt-get source git=1:1.9.1 \ + && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*") \ + && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control \ + && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules \ + && dpkg-buildpackage -rfakeroot -b \ + && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \; \ + && rm -rf /usr/src/git-openssl \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean + +# Install Docker +RUN set -x \ + && curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ + && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ + && tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \ + && rm docker.tgz \ + && docker -v \ +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box + && addgroup dockremap \ + && useradd -g dockremap dockremap \ + && echo 'dockremap:165536:65536' >> /etc/subuid \ + && echo 'dockremap:165536:65536' >> /etc/subgid \ + && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ + && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \ +# Ensure docker-compose works + && docker-compose version + +# Install dependencies by all python images equivalent to buildpack-deps:jessie +# on the public repos. + +RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ + && python /tmp/get-pip.py \ + && pip install awscli \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + +VOLUME /var/lib/docker + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["dockerd-entrypoint.sh"] + + +ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 +ENV SRC_DIR="/usr/src" \ + PHP_VERSION=5.6.33 \ + PHP_DOWNLOAD_SHA="9004995fdf55f111cd9020e8b8aff975df3d8d4191776c601a46988c375f3553" \ + PHPPATH="/php" \ + PHP_INI_DIR="/usr/local/etc/php" \ + PHP_CFLAGS="-fstack-protector -fpic -fpie -O2" \ + PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" + +ENV PHP_SRC_DIR="$SRC_DIR/php" \ + PHP_CPPFLAGS="$PHP_CFLAGS" \ + PHP_URL="https://secure.php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" \ + PHP_ASC_URL="https://secure.php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" + +# Install PHP +RUN set -xe; \ + mkdir -p $SRC_DIR; \ + cd $SRC_DIR; \ + wget -O php.tar.xz "$PHP_URL"; \ + echo "$PHP_DOWNLOAD_SHA *php.tar.xz" | sha256sum -c -; \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + ( gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" \ + || gpg --keyserver pgp.mit.edu --recv-keys "$key" \ + || gpg --keyserver keyserver.pgp.com --recv-keys "$key" ); \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -rf "$GNUPGHOME"; \ + + set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends libedit-dev=3.1-*; \ + rm -rf /var/lib/apt/lists/*; \ + apt-get clean; \ + + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ + ; \ + mkdir -p $PHP_SRC_DIR; \ + tar -Jxf $SRC_DIR/php.tar.xz -C $PHP_SRC_DIR --strip-components=1; \ + cd $SRC_DIR/php; \ + gnuArch="$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture -qDEB_BUILD_MULTIARCH)"; \ + + # https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + ./configure \ + --build="$gnuArch" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + --disable-cgi \ + # --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) + --enable-ftp \ + # --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) + --enable-mbstring \ + # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ + --with-curl \ + --with-libedit \ + --with-openssl \ + --with-zlib \ + # bundled pcre does not support JIT on s390x + + # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT + $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ + --with-libdir="lib/$debMultiarch" \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ + ; \ + make -j "$(nproc)"; \ + make test; \ + make install; \ + find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ + make clean; \ + cd /; \ + rm -rf $PHP_SRC_DIR; \ + + # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + php --version; \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ + + # Increase the memory size, default is 128M + mkdir "$PHP_INI_DIR"; \ + mkdir "$PHP_INI_DIR/conf.d"; \ + touch "$PHP_INI_DIR/conf.d/memory.ini" \ + && echo "memory_limit = 1G;" >> "$PHP_INI_DIR/conf.d/memory.ini"; + +ENV PATH="$PHPPATH/bin:/usr/local/php/bin:$PATH" + +# Install Composer globally +RUN wget https://getcomposer.org/download/1.6.3/composer.phar | php -- --install-dir=/usr/local/bin --filename=composer.phar + +WORKDIR $PHPPATH + +ENTRYPOINT ["dockerd-entrypoint.sh"] diff --git a/ubuntu/php/5.6/dockerd-entrypoint.sh b/ubuntu/php/5.6/dockerd-entrypoint.sh new file mode 100755 index 00000000..7af585c1 --- /dev/null +++ b/ubuntu/php/5.6/dockerd-entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +/usr/local/bin/dockerd \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=overlay &>/var/log/docker.log & + + +tries=0 +d_timeout=60 +until docker info >/dev/null 2>&1 +do + if [ "$tries" -gt "$d_timeout" ]; then + cat /var/log/docker.log + echo 'Timed out trying to connect to internal docker host.' >&2 + exit 1 + fi + tries=$(( $tries + 1 )) + sleep 1 +done + +eval "$@" diff --git a/ubuntu/php/7.0/Dockerfile b/ubuntu/php/7.0/Dockerfile new file mode 100644 index 00000000..eaecc43e --- /dev/null +++ b/ubuntu/php/7.0/Dockerfile @@ -0,0 +1,200 @@ +# Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/asl/ +# +# or in the "license" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +# + +FROM ubuntu:14.04.5 + +ENV DOCKER_BUCKET="download.docker.com" \ + DOCKER_VERSION="17.09.0-ce" \ + DOCKER_CHANNEL="stable" \ + DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \ + DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \ + DOCKER_COMPOSE_VERSION="1.16.1" + +# Building git from source code: +# Ubuntu's default git package is built with broken gnutls. Rebuild git with openssl. +########################################################################## +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates \ + tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-* \ + bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-* \ + libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~* \ + libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-* \ + libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-* \ + libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-* \ + libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.21-* libreadline-dev=6.3-* \ + libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-* \ + libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-* \ + patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-* \ + e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-* \ + && apt-get install -y -qq less=458-* groff=1.22.2-* \ + && apt-get -qy build-dep git=1:1.9.1 \ + && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-* \ + && mkdir -p /usr/src/git-openssl \ + && cd /usr/src/git-openssl \ + && apt-get source git=1:1.9.1 \ + && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*") \ + && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control \ + && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules \ + && dpkg-buildpackage -rfakeroot -b \ + && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \; \ + && rm -rf /usr/src/git-openssl \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean + +# Install Docker +RUN set -x \ + && curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ + && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ + && tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \ + && rm docker.tgz \ + && docker -v \ +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box + && addgroup dockremap \ + && useradd -g dockremap dockremap \ + && echo 'dockremap:165536:65536' >> /etc/subuid \ + && echo 'dockremap:165536:65536' >> /etc/subgid \ + && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ + && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \ +# Ensure docker-compose works + && docker-compose version + +# Install dependencies by all python images equivalent to buildpack-deps:jessie +# on the public repos. + +RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ + && python /tmp/get-pip.py \ + && pip install awscli \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + +VOLUME /var/lib/docker + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["dockerd-entrypoint.sh"] + + +ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 +ENV SRC_DIR="/usr/src" \ + PHP_VERSION=7.0.27 \ + PHP_DOWNLOAD_SHA="4b2bc823e806dbf7b62fe0b92b0d14b0c6e03f88c3fc5d96278416c54ce11f6c" \ + PHPPATH="/php" \ + PHP_INI_DIR="/usr/local/etc/php" \ + PHP_CFLAGS="-fstack-protector -fpic -fpie -O2" \ + PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" + +ENV PHP_SRC_DIR="$SRC_DIR/php" \ + PHP_CPPFLAGS="$PHP_CFLAGS" \ + PHP_URL="https://secure.php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" \ + PHP_ASC_URL="https://secure.php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" + +# Install PHP +RUN set -xe; \ + mkdir -p $SRC_DIR; \ + cd $SRC_DIR; \ + wget -O php.tar.xz "$PHP_URL"; \ + echo "$PHP_DOWNLOAD_SHA *php.tar.xz" | sha256sum -c -; \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + ( gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" \ + || gpg --keyserver pgp.mit.edu --recv-keys "$key" \ + || gpg --keyserver keyserver.pgp.com --recv-keys "$key" ); \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -rf "$GNUPGHOME"; \ + + set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends libedit-dev=3.1-*; \ + rm -rf /var/lib/apt/lists/*; \ + apt-get clean; \ + + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ + ; \ + mkdir -p $PHP_SRC_DIR; \ + tar -Jxf $SRC_DIR/php.tar.xz -C $PHP_SRC_DIR --strip-components=1; \ + cd $SRC_DIR/php; \ + gnuArch="$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture -qDEB_BUILD_MULTIARCH)"; \ + + # https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + ./configure \ + --build="$gnuArch" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + --disable-cgi \ + # --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) + --enable-ftp \ + # --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) + --enable-mbstring \ + # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ + # https://wiki.php.net/rfc/argon2_password_hash (7.2+) + --with-password-argon2 \ + --with-curl \ + --with-libedit \ + --with-openssl \ + --with-zlib \ + # bundled pcre does not support JIT on s390x + + # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT + $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ + --with-libdir="lib/$debMultiarch" \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ + ; \ + make -j "$(nproc)"; \ + make test; \ + make install; \ + find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ + make clean; \ + cd /; \ + rm -rf $PHP_SRC_DIR; \ + + # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + php --version; \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ + + # Increase the memory size, default is 128M + mkdir "$PHP_INI_DIR"; \ + mkdir "$PHP_INI_DIR/conf.d"; \ + touch "$PHP_INI_DIR/conf.d/memory.ini" \ + && echo "memory_limit = 1G;" >> "$PHP_INI_DIR/conf.d/memory.ini"; + +ENV PATH="$PHPPATH/bin:/usr/local/php/bin:$PATH" + +# Install Composer globally +RUN wget https://getcomposer.org/download/1.6.3/composer.phar | php -- --install-dir=/usr/local/bin --filename=composer.phar + +WORKDIR $PHPPATH + +ENTRYPOINT ["dockerd-entrypoint.sh"] diff --git a/ubuntu/php/7.0/dockerd-entrypoint.sh b/ubuntu/php/7.0/dockerd-entrypoint.sh new file mode 100755 index 00000000..7af585c1 --- /dev/null +++ b/ubuntu/php/7.0/dockerd-entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +/usr/local/bin/dockerd \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=overlay &>/var/log/docker.log & + + +tries=0 +d_timeout=60 +until docker info >/dev/null 2>&1 +do + if [ "$tries" -gt "$d_timeout" ]; then + cat /var/log/docker.log + echo 'Timed out trying to connect to internal docker host.' >&2 + exit 1 + fi + tries=$(( $tries + 1 )) + sleep 1 +done + +eval "$@" diff --git a/ubuntu/python/2.7.12/Dockerfile b/ubuntu/python/2.7.12/Dockerfile index 4a1de324..efc50543 100644 --- a/ubuntu/python/2.7.12/Dockerfile +++ b/ubuntu/python/2.7.12/Dockerfile @@ -116,7 +116,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") # https://github.com/docker-library/python/pull/143#issuecomment-241032683 && pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ - && pip install awscli==1.11.157 --no-cache-dir \ + && pip install awscli --no-cache-dir \ # then we use "pip list" to ensure we don't have more than one pip version installed # https://github.com/docker-library/python/pull/100 && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ diff --git a/ubuntu/python/3.3.6/Dockerfile b/ubuntu/python/3.3.6/Dockerfile index 88c1337e..76b1b8dc 100644 --- a/ubuntu/python/3.3.6/Dockerfile +++ b/ubuntu/python/3.3.6/Dockerfile @@ -119,7 +119,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") # https://github.com/docker-library/python/pull/143#issuecomment-241032683 && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ - && pip install awscli==1.11.157 --no-cache-dir \ + && pip install awscli --no-cache-dir \ # then we use "pip list" to ensure we don't have more than one pip version installed # https://github.com/docker-library/python/pull/100 && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ diff --git a/ubuntu/python/3.4.5/Dockerfile b/ubuntu/python/3.4.5/Dockerfile index 76c9500e..8cee3f49 100644 --- a/ubuntu/python/3.4.5/Dockerfile +++ b/ubuntu/python/3.4.5/Dockerfile @@ -119,7 +119,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") # https://github.com/docker-library/python/pull/143#issuecomment-241032683 && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ - && pip install awscli==1.11.157 --no-cache-dir \ + && pip install awscli --no-cache-dir \ # then we use "pip list" to ensure we don't have more than one pip version installed # https://github.com/docker-library/python/pull/100 && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ diff --git a/ubuntu/python/3.5.2/Dockerfile b/ubuntu/python/3.5.2/Dockerfile index dba946b4..18c162e0 100644 --- a/ubuntu/python/3.5.2/Dockerfile +++ b/ubuntu/python/3.5.2/Dockerfile @@ -119,7 +119,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") # https://github.com/docker-library/python/pull/143#issuecomment-241032683 && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ - && pip install awscli==1.11.157 --no-cache-dir \ + && pip install awscli --no-cache-dir \ # then we use "pip list" to ensure we don't have more than one pip version installed # https://github.com/docker-library/python/pull/100 && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ diff --git a/ubuntu/ruby/2.2.5/Dockerfile b/ubuntu/ruby/2.2.5/Dockerfile index 8960df16..17596547 100644 --- a/ubuntu/ruby/2.2.5/Dockerfile +++ b/ubuntu/ruby/2.2.5/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/ruby/2.3.1/Dockerfile b/ubuntu/ruby/2.3.1/Dockerfile index 014f37c1..0a7e8140 100644 --- a/ubuntu/ruby/2.3.1/Dockerfile +++ b/ubuntu/ruby/2.3.1/Dockerfile @@ -74,7 +74,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker diff --git a/ubuntu/ubuntu-base/14.04/Dockerfile b/ubuntu/ubuntu-base/14.04/Dockerfile index eb41be1e..9163c63d 100644 --- a/ubuntu/ubuntu-base/14.04/Dockerfile +++ b/ubuntu/ubuntu-base/14.04/Dockerfile @@ -62,7 +62,7 @@ RUN set -x \ RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \ && python /tmp/get-pip.py \ - && pip install awscli==1.11.157 \ + && pip install awscli \ && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /var/lib/docker