|
| 1 | +-e # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. |
| 4 | +# A copy of the License is located at |
| 5 | +# |
| 6 | +# http://aws.amazon.com/asl/ |
| 7 | +# |
| 8 | +# or in the "license" file accompanying this file. |
| 9 | +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. |
| 10 | +# See the License for the specific language governing permissions and limitations under the License. |
| 11 | +# |
| 12 | + |
| 13 | +FROM ubuntu:14.04.5 |
| 14 | + |
| 15 | +ENV DOCKER_BUCKET="download.docker.com" \ |
| 16 | + DOCKER_VERSION="18.09.0" \ |
| 17 | + DOCKER_CHANNEL="stable" \ |
| 18 | + DOCKER_SHA256="08795696e852328d66753963249f4396af2295a7fe2847b839f7102e25e47cb9" \ |
| 19 | + DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \ |
| 20 | + DOCKER_COMPOSE_VERSION="1.23.2" \ |
| 21 | + GITVERSION_VERSION="3.6.5" |
| 22 | + |
| 23 | +# Install git, SSH, and other utilities |
| 24 | +RUN set -ex \ |
| 25 | + && echo 'Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/99use-gzip-compression \ |
| 26 | + && apt-get update \ |
| 27 | + && apt install -y apt-transport-https \ |
| 28 | + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ |
| 29 | + && echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | tee /etc/apt/sources.list.d/mono-official-stable.list \ |
| 30 | + && apt-get update \ |
| 31 | + && apt-get install software-properties-common -y --no-install-recommends \ |
| 32 | + && apt-add-repository ppa:git-core/ppa \ |
| 33 | + && apt-get update \ |
| 34 | + && apt-get install git=1:2.* -y --no-install-recommends \ |
| 35 | + && git version \ |
| 36 | + && apt-get install -y --no-install-recommends openssh-client=1:6.6* \ |
| 37 | + && mkdir ~/.ssh \ |
| 38 | + && touch ~/.ssh/known_hosts \ |
| 39 | + && ssh-keyscan -t rsa,dsa -H github.com >> ~/.ssh/known_hosts \ |
| 40 | + && ssh-keyscan -t rsa,dsa -H bitbucket.org >> ~/.ssh/known_hosts \ |
| 41 | + && chmod 600 ~/.ssh/known_hosts \ |
| 42 | + && apt-get install -y --no-install-recommends \ |
| 43 | + wget=1.15-* python3=3.4.* python3.4-dev=3.4.* fakeroot=1.20-* ca-certificates jq \ |
| 44 | + tar=1.27.* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.* \ |
| 45 | + bzip2=1.0.* file=1:5.14-* g++=4:4.8.* gcc=4:4.8.* imagemagick=8:6.7.* \ |
| 46 | + libbz2-dev=1.0.* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.* libdb-dev=1:5.3.* \ |
| 47 | + libevent-dev=2.0.* libffi-dev=3.1~* libgeoip-dev=1.6.* libglib2.0-dev=2.40.* \ |
| 48 | + libjpeg-dev=8c-* libkrb5-dev=1.12+* liblzma-dev=5.1.* \ |
| 49 | + libmagickcore-dev=8:6.7.* libmagickwand-dev=8:6.7.* libmysqlclient-dev=5.5.* \ |
| 50 | + libncurses5-dev=5.9+* libpng12-dev=1.2.* libpq-dev=9.3.* libreadline-dev=6.3-* \ |
| 51 | + libsqlite3-dev=3.8.* libssl-dev=1.0.* libtool=2.4.* libwebp-dev=0.4.* \ |
| 52 | + libxml2-dev=2.9.* libxslt1-dev=1.1.* libyaml-dev=0.1.* make=3.81-* \ |
| 53 | + patch=2.7.* xz-utils=5.1.* zlib1g-dev=1:1.2.* unzip=6.0-* curl=7.35.* \ |
| 54 | + e2fsprogs=1.42.* iptables=1.4.* xfsprogs=3.1.* xz-utils=5.1.* \ |
| 55 | + mono-devel=5.* less=458-* groff=1.22.* liberror-perl=0.17-* \ |
| 56 | + asciidoc=8.6.* build-essential=11.* bzr=2.6.* cvs=2:1.12.* cvsps=2.1-* docbook-xml=4.5-* docbook-xsl=1.78.* dpkg-dev=1.17.* \ |
| 57 | + libdbd-sqlite3-perl=1.40-* libdbi-perl=1.630-* libdpkg-perl=1.17.* libhttp-date-perl=6.02-* \ |
| 58 | + libio-pty-perl=1:1.08-* libserf-1-1=1.3.* libsvn-perl=1.8.* libsvn1=1.8.* libtcl8.6=8.6.* libtimedate-perl=2.3000-* \ |
| 59 | + libunistring0=0.9.* libxml2-utils=2.9.* libyaml-perl=0.84-* python-bzrlib=2.6.* python-configobj=4.7.* \ |
| 60 | + sgml-base=1.26+* sgml-data=2.0.* subversion=1.8.* tcl=8.6.* tcl8.6=8.6.* xml-core=0.13+* xmlto=0.0.* xsltproc=1.1.* python3-pip \ |
| 61 | + tk=8.6.* gettext=0.18.* gettext-base=0.18.* libapr1=1.5.* libaprutil1=1.5.* libasprintf0c2=0.18.* \ |
| 62 | + && rm -rf /var/lib/apt/lists/* \ |
| 63 | + && apt-get clean |
| 64 | + |
| 65 | +# Download and set up GitVersion |
| 66 | +RUN set -ex \ |
| 67 | + && wget "https://github.com/GitTools/GitVersion/releases/download/v${GITVERSION_VERSION}/GitVersion_${GITVERSION_VERSION}.zip" -O /tmp/GitVersion_${GITVERSION_VERSION}.zip \ |
| 68 | + && mkdir -p /usr/local/GitVersion_${GITVERSION_VERSION} \ |
| 69 | + && unzip /tmp/GitVersion_${GITVERSION_VERSION}.zip -d /usr/local/GitVersion_${GITVERSION_VERSION} \ |
| 70 | + && rm /tmp/GitVersion_${GITVERSION_VERSION}.zip \ |
| 71 | + && echo "mono /usr/local/GitVersion_${GITVERSION_VERSION}/GitVersion.exe \$@" >> /usr/local/bin/gitversion \ |
| 72 | + && chmod +x /usr/local/bin/gitversion |
| 73 | + |
| 74 | +# Install Docker |
| 75 | +RUN set -ex \ |
| 76 | + && curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ |
| 77 | + && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ |
| 78 | + && tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \ |
| 79 | + && rm docker.tgz \ |
| 80 | + && docker -v \ |
| 81 | +# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box |
| 82 | + && addgroup dockremap \ |
| 83 | + && useradd -g dockremap dockremap \ |
| 84 | + && echo 'dockremap:165536:65536' >> /etc/subuid \ |
| 85 | + && echo 'dockremap:165536:65536' >> /etc/subgid \ |
| 86 | + && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ |
| 87 | + && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \ |
| 88 | + && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \ |
| 89 | +# Ensure docker-compose works |
| 90 | + && docker-compose version |
| 91 | + |
| 92 | +# Install dependencies by all python images equivalent to buildpack-deps:jessie |
| 93 | +# on the public repos. |
| 94 | + |
| 95 | +RUN set -ex \ |
| 96 | + && pip3 install awscli boto3 |
| 97 | + |
| 98 | +VOLUME /var/lib/docker |
| 99 | + |
| 100 | +# Configure SSH |
| 101 | +COPY ssh_config /root/.ssh/config |
| 102 | + |
| 103 | +COPY dockerd-entrypoint.sh /usr/local/bin/ |
| 104 | + |
| 105 | +ENV GOLANG_VERSION="1.11.2" \ |
| 106 | + GOLANG_DOWNLOAD_SHA256="1dfe664fa3d8ad714bbd15a36627992effd150ddabd7523931f077b3926d736d" \ |
| 107 | + GOPATH="/go" \ |
| 108 | + DEP_VERSION="0.5.0" \ |
| 109 | + DEP_BINARY="dep-linux-amd64" |
| 110 | + |
| 111 | +RUN set -ex \ |
| 112 | + && mkdir -p "$GOPATH/src" "$GOPATH/bin" \ |
| 113 | + && chmod -R 777 "$GOPATH" \ |
| 114 | + && apt-get update && apt-get install -y --no-install-recommends \ |
| 115 | + pkg-config=0.26-* \ |
| 116 | + && apt-get clean \ |
| 117 | + && wget "https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz" -O /tmp/golang.tar.gz \ |
| 118 | + && echo "$GOLANG_DOWNLOAD_SHA256 /tmp/golang.tar.gz" | sha256sum -c - \ |
| 119 | + && tar -xzf /tmp/golang.tar.gz -C /usr/local \ |
| 120 | + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ |
| 121 | + && wget "https://github.com/golang/dep/releases/download/v$DEP_VERSION/$DEP_BINARY" -O "$GOPATH/bin/dep" \ |
| 122 | + && chmod +x "$GOPATH/bin/dep" |
| 123 | + |
| 124 | +ENV PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" |
| 125 | +WORKDIR $GOPATH |
0 commit comments