Skip to content

Commit

Permalink
Merge pull request #719 from LZY7977/master
Browse files Browse the repository at this point in the history
add x86_64/aarch64 dotnet8
  • Loading branch information
LZY7977 authored May 7, 2024
2 parents 2f7c470 + bc7338a commit cfe0f93
Show file tree
Hide file tree
Showing 4 changed files with 594 additions and 0 deletions.
139 changes: 139 additions & 0 deletions al-lambda/aarch64/dotnet8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Copyright 2020-2023 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 public.ecr.aws/lambda/dotnet:8-arm64 AS core

# Install SSH, and other utilities
RUN set -ex \
&& dnf install -y openssh-clients \
&& mkdir ~/.ssh \
&& mkdir -p /opt/tools \
&& mkdir -p /codebuild/image/config \
&& touch ~/.ssh/known_hosts \
&& ssh-keyscan -t rsa,dsa,ed25519,ecdsa -H github.com >> ~/.ssh/known_hosts \
&& ssh-keyscan -t rsa,dsa,ed25519,ecdsa -H bitbucket.org >> ~/.ssh/known_hosts \
&& chmod 600 ~/.ssh/known_hosts \
&& rpm --import https://download.mono-project.com/repo/xamarin.gpg \
&& curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo \
&& dnf install -y make gcc gettext \
&& dnf install -y \
ImageMagick asciidoc bzip2-devel cvs cvsps \
docbook-dtds docbook-style-xsl e2fsprogs expat-devel expect fakeroot \
glib2-devel groff gzip icu iptables jq krb5-server libargon2-devel \
libcurl-devel libdb-devel libedit-devel libevent-devel libffi-devel \
libicu-devel libjpeg-devel libpng-devel libserf sqlite-devel \
libtidy-devel libunwind libwebp-devel libxml2-devel libxslt libxslt-devel \
libyaml-devel libzip-devel mariadb105-devel mercurial mlocate \
ncurses-devel oniguruma-devel openssl openssl-devel perl-DBD-SQLite \
perl-DBI perl-HTTP-Date perl-TimeDate perl-YAML-LibYAML \
postgresql-devel procps-ng python-configobj readline-devel rsync sgml-common \
subversion-perl tar tcl tk vim wget which xfsprogs xmlto xorg-x11-server-Xvfb xz-devel \
amazon-ecr-credential-helper \
&& rm /etc/yum.repos.d/mono-centos7-stable.repo

RUN /usr/sbin/useradd codebuild-user

ENV HOME="/tmp"
ENV LAMBDA_USER_HOME="/tmp/opt"
#=======================End of layer: core =================

FROM core AS tools

# Install Git
RUN set -ex \
&& GIT_VERSION=2.44.0 \
&& GIT_TAR_FILE=git-$GIT_VERSION.tar.gz \
&& GIT_SRC=https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz \
&& curl -L -o $GIT_TAR_FILE $GIT_SRC \
&& tar zxf $GIT_TAR_FILE \
&& cd git-$GIT_VERSION \
&& make -j4 prefix=/usr \
&& make install prefix=/usr \
&& cd .. && rm -rf git-$GIT_VERSION \
&& rm -rf $GIT_TAR_FILE /tmp/*

# Install AWS CLI v2
# https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /opt \
&& /opt/aws/install --update -i /usr/local/aws-cli -b /usr/local/bin \
&& rm /tmp/awscliv2.zip \
&& rm -rf /opt/aws \
&& aws --version

# Install AWS SAM CLI
RUN wget -nv https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-arm64.zip -O /tmp/samcli.zip \
&& unzip -q /tmp/samcli.zip -d /opt \
&& /opt/install --update -i /usr/local/sam-cli -b /usr/local/bin \
&& rm /tmp/samcli.zip /opt/install \
&& rm -rf /opt/aws-sam-cli-src \
&& sam --version

# AWS Tools
# 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
RUN curl -sS -o /usr/local/bin/aws-iam-authenticator https://s3.us-west-2.amazonaws.com/amazon-eks/1.27.1/2023-04-19/bin/linux/arm64/aws-iam-authenticator \
&& curl -sS -o /usr/local/bin/kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.27.1/2023-04-19/bin/linux/arm64/kubectl \
&& curl -sS -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-arm64-latest \
&& curl -sS -L https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_arm64.tar.gz | tar xz -C /usr/local/bin \
&& chmod +x /usr/local/bin/kubectl /usr/local/bin/aws-iam-authenticator /usr/local/bin/ecs-cli /usr/local/bin/eksctl
#======================= End of layer: tools =================

FROM tools AS dotnet_runtime

ENV DOTNET_SDK_VERSION "8.0.204"
ENV DOTNET_SDK_DOWNLOAD_URL "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-arm64.tar.gz"
ENV DOTNET_SDK_DOWNLOAD_SHA512 "7000b559efe502e9a799e9fccb6bccc2e39eb21331d6cb2be54f389e357436b84f5ccbcc73245df647749ee32d27f7fb8b7737d449312f0db7dd3409f8e12443"
ENV DOTNET_DIR "/var/lang/bin"

RUN set -ex \
&& curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \
&& echo "$DOTNET_SDK_DOWNLOAD_SHA512 dotnet.tar.gz" | sha512sum -c - \
&& tar -zxf dotnet.tar.gz -C $DOTNET_DIR \
&& rm dotnet.tar.gz

# Add .NET Core Global Tools install folder to PATH
ENV DOTNET_CLI_HOME=$LAMBDA_USER_HOME \
PATH="$LAMBDA_USER_HOME/.dotnet/tools:$PATH"

# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT true
RUN set -ex \
&& mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rm -rf warmup \
&& rm -rf /tmp/NuGetScratch

# Install Powershell Core
# See instructions at https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux
ENV POWERSHELL_VERSION 7.4.2
ENV POWERSHELL_DOWNLOAD_URL https://github.com/PowerShell/PowerShell/releases/download/v$POWERSHELL_VERSION/powershell-$POWERSHELL_VERSION-linux-arm64.tar.gz
ENV POWERSHELL_DOWNLOAD_SHA 006021694A9E0CE962457D23189E3CB88AE030863B221907F8FB891DF9497AEB

RUN set -ex \
&& curl -SL $POWERSHELL_DOWNLOAD_URL --output powershell.tar.gz \
&& echo "$POWERSHELL_DOWNLOAD_SHA powershell.tar.gz" | sha256sum -c - \
&& mkdir -p /opt/microsoft/powershell/$POWERSHELL_VERSION \
&& tar zxf powershell.tar.gz -C /opt/microsoft/powershell/$POWERSHELL_VERSION \
&& rm powershell.tar.gz \
&& ln -s /opt/microsoft/powershell/$POWERSHELL_VERSION/pwsh /usr/bin/pwsh \
&& pwsh --version
#=======================End of layer: dotnet_runtime =================

FROM dotnet_runtime AS al_v1

COPY legal/bill_of_material.txt /usr/share/doc/bill_of_material.txt

# Cleanup
RUN rm -fr /tmp/*
#=======================End of layer: al_lambda_v1 =================
158 changes: 158 additions & 0 deletions al-lambda/aarch64/dotnet8/legal/bill_of_material.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
The Amazon CodeBuild Product includes the following third-party software/licensing:

----------------
GeoIP-devel : LGPLv2+ and GPLv2+ and CC-BY-SA
----------------
ImageMagick : ImageMagick
----------------
asciidoc : GPL+ and GPLv2+
----------------
bzip2-devel : BSD
----------------
bzr : GPLv2+
----------------
bzrtools : GPLv2+
----------------
cvs : BSD and GPL+ and GPLv2+ and LGPLv2+ and zlib and Public Domain
----------------
cvsps : GPL+
----------------
dbus-glib-devel : AFL and GPLv2+
----------------
docbook-dtds : Copyright only
----------------
docbook-style-xsl : DMIT
----------------
dpkg-dev : GPLv2 and GPLv2+ and LGPLv2+ and Public Domain and BSD
----------------
e2fsprogs : GPLv2
----------------
expat-devel : MIT
----------------
expect : Public Domain
----------------
fakeroot : GPLv3+ and LGPLv2+ and (GPL+ or Artistic)
----------------
glib2-devel : LGPLv2+
----------------
groff : GPLv3+ and GFDL and BSD and MIT
----------------
gtk3-devel : LGPLv2+
----------------
gzip : GPLv3+ and GFDL
----------------
icu : MIT and UCD and Public Domain
----------------
iptables : GPLv2
----------------
jq : MIT and ASL 2.0 and CC-BY and GPLv3
----------------
krb5-server : MIT
----------------
libargon2-devel : Public Domain or ASL 2.0
----------------
libcurl-devel : MIT
----------------
libdb-devel : BSD and LGPLv2 and Sleepycat
----------------
libedit-devel : BSD
----------------
libevent-devel : BSD
----------------
libffi-devel : MIT and Public Domain
----------------
libgit2 : GPLv2 with exceptions
----------------
libicu-devel : MIT and UCD and Public Domain
----------------
libpng-devel : zlib
----------------
libserf : ASL 2.0
----------------
libsqlite3x-devel : zlib
----------------
libtidy-devel : W3C
----------------
libunwind : BSD
----------------
libwebp-devel : BSD
----------------
libxml2-devel : MIT
----------------
libxslt : MIT
----------------
libxslt-devel : MIT
----------------
libyaml-devel : MIT
----------------
libzip-devel : BSD
----------------
mariadb-devel : GPLv2 with exceptions and LGPLv2 and BSD
----------------
mercurial : GPLv2+
----------------
mlocate : GPLv2
----------------
mono-devel : LGPL-2.1
----------------
ncurses-devel : MIT
----------------
oniguruma-devel : BSD
----------------
openssh-clients : BSD
----------------
openssl : OpenSSL
----------------
openssl-devel : OpenSSL
----------------
perl-DBD-SQLite : GPL+ or Artistic
----------------
perl-DBI : GPL+ or Artistic
----------------
perl-HTTP-Date : GPL+ or Artistic
----------------
perl-IO-Pty-Easy : GPL+ or Artistic
----------------
perl-TimeDate : GPL+ or Artistic
----------------
perl-YAML-LibYAML : GPL+ or Artistic
----------------
postgresql-devel : PostgreSQL
----------------
procps-ng : GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
----------------
readline-devel : GPLv3+
----------------
rsync : GPLv3+
----------------
sbt : BSD
----------------
sgml-common : GPL+
----------------
subversion-perl : ASL 2.0
----------------
tar : GPLv3+
----------------
tcl : TCL
----------------
tk : TCL
----------------
wget : GPLv3+
----------------
which : GPLv3
----------------
xfsprogs : GPL+ and LGPLv2+
----------------
xmlto : GPLv2+
----------------
xorg-x11-server-Xvfb : MIT and GPLv2
----------------
xz-devel : LGPLv2+
----------------
gitversion :https://github.com/GitTools/GitVersion/blob/master/LICENSE
----------------
docker :https://www.docker.com/legal/components-licenses
----------------
dotnet :https://github.com/dotnet/core/blob/master/LICENSE.TXT
----------------

Loading

0 comments on commit cfe0f93

Please sign in to comment.