1+ # Copyright 2019-2020 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+
112FROM amazonlinux:2
213
314ENV RUBY_VERSION="2.6.5" \
@@ -11,18 +22,17 @@ ENV RUBY_VERSION="2.6.5" \
1122 GOLANG_VERSION="1.13.1" \
1223 GOLANG_12_VERSION="1.12.9" \
1324 DOCKER_18_VERSION="18.09.6" \
14- DOCKER_VERSION="19.03.1 " \
15- DOCKER_COMPOSE_VERSION="1.24 .0"
25+ DOCKER_VERSION="19.03.11 " \
26+ DOCKER_COMPOSE_VERSION="1.26 .0"
1627
1728ARG CHINA_REGION
1829
1930# **************** Utilities *********************************************
2031ENV DOCKER_BUCKET="download.docker.com" \
2132 DOCKER_CHANNEL="stable" \
2233 DOCKER_18_SHA256="c4857639514471e2d1aa6d567880b7fc226437ede462021ed44157d4dcd11dc8" \
23- DOCKER_SHA256="44158b9fe44e8b5d3c1226a5d880425850d6f8ec383e4cf053f401e1a8fc269d " \
34+ DOCKER_SHA256="9cd49fe82f6b7ec413b04daef35bc0c87b01d6da67611e5beef36291538d3145 " \
2435 DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \
25- GITVERSION_VERSION="4.0.0" \
2636 DEBIAN_FRONTEND="noninteractive" \
2737 SRC_DIR="/usr/src" \
2838 EPEL_REPO="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
@@ -57,9 +67,22 @@ RUN set -ex \
5767 perl-IO-Pty-Easy libserf subversion-perl tcl perl-TimeDate \
5868 perl-YAML-LibYAML bzrtools python-configobj \
5969 sgml-common xmlto libxslt \
60- tk xorg-x11-server-Xvfb expect parallel rsync \
70+ tk xorg-x11-server-Xvfb expect rsync \
6171 && yum clean all
6272
73+ # Install Git
74+ RUN set -ex \
75+ && GIT_VERSION=2.27.0 \
76+ && GIT_TAR_FILE=git-$GIT_VERSION.tar.gz \
77+ && GIT_SRC=https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz \
78+ && curl -L -o $GIT_TAR_FILE $GIT_SRC \
79+ && tar zxvf $GIT_TAR_FILE \
80+ && cd git-$GIT_VERSION \
81+ && make -j4 prefix=/usr \
82+ && make install prefix=/usr \
83+ && cd .. ; rm -rf git-$GIT_VERSION \
84+ && rm -rf $GIT_TAR_FILE /tmp/*
85+
6386# Install Docker
6487ENV DOCKER_18_PATH=/usr/local/bin/docker18
6588ENV DOCKER_PATH=/usr/local/bin/docker19
@@ -90,23 +113,25 @@ RUN set -ex \
90113 && useradd -g dockremap dockremap \
91114 && echo 'dockremap:165536:65536' >> /etc/subuid \
92115 && echo 'dockremap:165536:65536' >> /etc/subgid \
93- && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind
94- # TODO there is no existing docker compose executable for ARM.
95- # && curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \
96- # && chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose
97- # && docker-compose version
98-
99- # https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html
100- RUN curl -sS -o /usr/local/bin/aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/aws-iam-authenticator \
101- && curl -sS -o /usr/local/bin/kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/kubectl \
102- && curl -sS -o /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-latest \
103- && chmod +x /usr/local/bin/kubectl /usr/local/bin/aws-iam-authenticator /usr/local/bin/ecs-cli
116+ && wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \
117+ && chmod +x /usr/local/bin/dind
118+
119+ # AWS Tools
120+ # https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html
121+ RUN curl -sS -o /usr/local/bin/aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.16.8/2020-04-16/bin/linux/arm64/aws-iam-authenticator \
122+ && curl -sS -o /usr/local/bin/kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.16.8/2020-04-16/bin/linux/arm64/kubectl \
123+ && chmod +x /usr/local/bin/kubectl /usr/local/bin/aws-iam-authenticator
104124
105125VOLUME /var/lib/docker
106126
107127# Configure SSH
108128COPY ssh_config /root/.ssh/config
109129
130+ # Configure SSM
131+ RUN set -ex \
132+ && yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_arm64/amazon-ssm-agent.rpm
133+ COPY amazon-ssm-agent.json /etc/amazon/ssm/
134+
110135COPY runtimes.yml /codebuild/image/config/runtimes.yml
111136
112137COPY dockerd-entrypoint.sh /usr/local/bin/
@@ -283,7 +308,7 @@ ENV PATH="/root/.local/bin:$PATH"
283308RUN set -ex \
284309 && /usr/local/python38/bin/pip3 install --user aws-sam-cli \
285310 && sam --version \
286- && /usr/local/python38/bin/pip3 install awscli boto3
311+ && /usr/local/python38/bin/pip3 install awscli boto3 "docker-compose==$DOCKER_COMPOSE_VERSION"
287312
288313RUN cd /usr/local/python38/bin \
289314 && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
@@ -484,7 +509,7 @@ RUN set -ex \
484509 && yum clean all
485510# **************** END JAVA ****************************************************
486511
487- # **************** GO (latest 1.13) **********************************************************
512+ # **************** GO 1.13 **********************************************************
488513ENV GOLANG_DOWNLOAD_SHA256="8af8787b7c2a3c0eb3f20f872577fcb6c36098bf725c59c4923921443084c807" \
489514 GOPATH="/go" \
490515 DEP_VERSION="0.5.1" \
@@ -518,16 +543,6 @@ RUN set -ex \
518543
519544# **************** END GO **********************************************************
520545
521- # TODO Download libgit2 (no aarch version at rpmfind.net/linux/centos/7/extras)
522-
523- RUN set -ex \
524- && wget "https://github.com/GitTools/GitVersion/releases/download/v${GITVERSION_VERSION}/GitVersion-bin-net40-v${GITVERSION_VERSION}.zip" -O /tmp/GitVersion_${GITVERSION_VERSION}.zip \
525- && mkdir -p /usr/local/GitVersion_${GITVERSION_VERSION} \
526- && unzip /tmp/GitVersion_${GITVERSION_VERSION}.zip -d /usr/local/GitVersion_${GITVERSION_VERSION} \
527- && rm /tmp/GitVersion_${GITVERSION_VERSION}.zip \
528- && echo "mono /usr/local/GitVersion_${GITVERSION_VERSION}/GitVersion.exe \$ @" >> /usr/local/bin/gitversion \
529- && chmod +x /usr/local/bin/gitversion
530-
531546RUN set -ex \
532547 && yum install -y openssl \
533548 && curl -o stunnel-5.55.tar.gz https://www.stunnel.org/downloads/stunnel-5.55.tar.gz \
0 commit comments