diff --git a/2.0.5/Dockerfile b/2.0.5/Dockerfile new file mode 100644 index 0000000..d0b1302 --- /dev/null +++ b/2.0.5/Dockerfile @@ -0,0 +1,32 @@ +FROM microsoft/aspnetcore:2.0.5 +MAINTAINER Azure App Services Container Images + +COPY bin.zip /tmp +COPY init_container.sh /bin/ +COPY hostingstart.html /home/site/wwwroot/ +COPY sshd_config /etc/ssh/ + +RUN apt-get update \ + && apt-get install -y apt-utils --no-install-recommends \ + && apt-get install -y unzip --no-install-recommends \ + && mkdir -p /defaulthome/hostingstart \ + && unzip -q -o /tmp/bin.zip -d /defaulthome/hostingstart \ + && rm /tmp/bin.zip \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc \ + && apt update \ + && apt install -y --no-install-recommends openssh-server vim curl wget tcptraceroute \ + && chmod 755 /bin/init_container.sh \ + && mkdir -p /home/LogFiles/ + +EXPOSE 2222 8080 + +ENV PORT 8080 +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot +ENV ASPNETCORE_URLS= + +WORKDIR /home/site/wwwroot + +ENTRYPOINT ["/bin/init_container.sh"] diff --git a/2.0.5/bin.zip b/2.0.5/bin.zip new file mode 100644 index 0000000..50d80ec Binary files /dev/null and b/2.0.5/bin.zip differ diff --git a/2.0.5/build.sh b/2.0.5/build.sh new file mode 100644 index 0000000..45353a3 --- /dev/null +++ b/2.0.5/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +cd src +sudo rm -rf bin obj publish +docker run --rm -v $(pwd):/src -w /src microsoft/dotnet /bin/bash -c "dotnet restore && dotnet publish -o publish" +cd publish +zip -r ../../bin.zip * diff --git a/2.0.5/hostingstart.html b/2.0.5/hostingstart.html new file mode 100644 index 0000000..21d974c --- /dev/null +++ b/2.0.5/hostingstart.html @@ -0,0 +1,38 @@ + + + + + + + +Microsoft Azure App Service - Welcome + + + + + + +
+
+hostingstart-v2-02 +
+
+

Your App Service app has been created

+

Go to your app's + +Quick Start guide in the Azure portal to get started or read our + +deployment documentation. +

+
+
+ + + + \ No newline at end of file diff --git a/2.0.5/init_container.sh b/2.0.5/init_container.sh new file mode 100644 index 0000000..f85c71f --- /dev/null +++ b/2.0.5/init_container.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +Dotnet quickstart: https://aka.ms/dotnet-qs + +EOL +cat /etc/motd + +service ssh start + +[ -z "$ASPNETCORE_URLS" ] && export ASPNETCORE_URLS=http://*:"$PORT" + +# If there is any command line argument specified, run it +[ $# -ne 0 ] && exec "$@" + +# Pick up one .csproj file from repository where git push puts files into +CSPROJ=`ls -1 /home/site/repository/*.csproj 2>/dev/null | head -1` + +# Convert /home/site/repository/.csproj into ./.dll and execute it +if [ -n "$CSPROJ" ]; then + DLL=./`basename "$CSPROJ" .csproj`.dll + echo Found: $DLL + [ -e "$DLL" ] && exec dotnet "$DLL" +fi + +echo Could not find .csproj or .dll. Using default. +cd /defaulthome/hostingstart +exec dotnet hostingstart.dll diff --git a/2.0.5/src/Program.cs b/2.0.5/src/Program.cs new file mode 100644 index 0000000..babecdd --- /dev/null +++ b/2.0.5/src/Program.cs @@ -0,0 +1,19 @@ +using System; +using Microsoft.AspNetCore.Hosting; + +namespace hostingstart +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseStartup() + .UseWebRoot("/home/site/wwwroot") + .Build(); + + host.Run(); + } + } +} diff --git a/2.0.5/src/Startup.cs b/2.0.5/src/Startup.cs new file mode 100644 index 0000000..517d61c --- /dev/null +++ b/2.0.5/src/Startup.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.FileProviders; +using Microsoft.AspNetCore.StaticFiles; + +namespace hostingstart +{ + public class Startup + { + public void Configure(IApplicationBuilder app) + { + var options = new DefaultFilesOptions(); + options.DefaultFileNames.Add("hostingstart.html"); + + app.UseDefaultFiles(options) + .UseStaticFiles(); + } + } +} diff --git a/2.0.5/src/hostingstart.csproj b/2.0.5/src/hostingstart.csproj new file mode 100644 index 0000000..d58e53a --- /dev/null +++ b/2.0.5/src/hostingstart.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp2.0 + + + + + + + + + + + diff --git a/2.0.5/sshd_config b/2.0.5/sshd_config new file mode 100644 index 0000000..a3690f2 --- /dev/null +++ b/2.0.5/sshd_config @@ -0,0 +1,15 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port 2222 +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes diff --git a/build.sh b/build.sh index 76453ab..15e61d3 100755 --- a/build.sh +++ b/build.sh @@ -1,18 +1,20 @@ !/usr/bin/env bash -set -x -e +set -euo pipefail buildnumber=${4-$(date -u +"%y%m%d%H%M")} docker build -t "$1"/dotnetcore:1.0.5_"$buildnumber" -t "$1"/dotnetcore:lts_"$buildnumber" 1.0.5 docker build -t "$1"/dotnetcore:1.1.2_"$buildnumber" 1.1.2 -docker build -t "$1"/dotnetcore:2.0.0_"$buildnumber" -t "$1"/dotnetcore:latest_"$buildnumber" 2.0.0 +docker build -t "$1"/dotnetcore:2.0.0_"$buildnumber" 2.0.0 +docker build -t "$1"/dotnetcore:2.0.5_"$buildnumber" -t "$1"/dotnetcore:latest_"$buildnumber" 2.0.5 docker login -u "$2" -p "$3" docker push "$1"/dotnetcore:lts_"$buildnumber" docker push "$1"/dotnetcore:1.0.5_"$buildnumber" docker push "$1"/dotnetcore:1.1.2_"$buildnumber" -docker push "$1"/dotnetcore:latest_"$buildnumber" docker push "$1"/dotnetcore:2.0.0_"$buildnumber" +docker push "$1"/dotnetcore:2.0.5_"$buildnumber" +docker push "$1"/dotnetcore:latest_"$buildnumber" docker logout