├── .gitignore ├── LICENSE.TXT ├── README.DockerHub.md ├── README.md ├── aspnetapp ├── .bowerrc ├── .dockerignore ├── Controllers │ └── HomeController.cs ├── Dockerfile ├── Program.cs ├── README.md ├── Startup.cs ├── Views │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json ├── aspnetapp.csproj ├── bower.json ├── bundleconfig.json └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ ├── banner1.svg │ ├── banner2.svg │ ├── banner3.svg │ └── banner4.svg │ ├── js │ ├── site.js │ └── site.min.js │ └── lib │ ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── .bower.json │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── build-pipeline ├── README.md ├── dotnet-docker-samples-linux-amd64-images.json ├── dotnet-docker-samples-linux-arm32v7-images.json ├── dotnet-docker-samples-post-image-build.json ├── dotnet-docker-samples-windows-1709-amd64-images.json ├── dotnet-docker-samples-windows-amd64-images.json └── pipeline.json ├── dotnetapp-dev ├── .dockerignore ├── Dockerfile ├── README.md ├── dotnetapp-dev.sln ├── dotnetapp │ ├── Program.cs │ └── dotnetapp.csproj ├── tests │ ├── UnitTest1.cs │ └── tests.csproj └── utils │ ├── ReverseUtil.cs │ └── utils.csproj ├── dotnetapp-prod-alpine-preview ├── .dockerignore ├── Dockerfile ├── Dockerfile.globalization ├── NuGet.config ├── Program.cs ├── README.md └── dotnetapp.csproj ├── dotnetapp-prod ├── .dockerignore ├── Dockerfile ├── Dockerfile.arm32 ├── Program.cs ├── README.md └── dotnetapp.csproj ├── dotnetapp-selfcontained ├── .dockerignore ├── Dockerfile ├── Dockerfile.arm32 ├── Dockerfile.nano ├── Program.cs ├── README.md ├── dotnetapp.csproj └── nuget.config └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | [Oo]ut/ 25 | [Pp]ublished/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | 50 | *_i.c 51 | *_p.c 52 | *_i.h 53 | *.ilk 54 | *.meta 55 | *.obj 56 | *.pch 57 | *.pdb 58 | *.pgc 59 | *.pgd 60 | *.rsp 61 | *.sbr 62 | *.tlb 63 | *.tli 64 | *.tlh 65 | *.tmp 66 | *.tmp_proj 67 | *.log 68 | *.vspscc 69 | *.vssscc 70 | .builds 71 | *.pidb 72 | *.svclog 73 | *.scc 74 | 75 | # Chutzpah Test files 76 | _Chutzpah* 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opendb 83 | *.opensdf 84 | *.sdf 85 | *.cachefile 86 | *.VC.db 87 | *.VC.VC.opendb 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | *.sap 94 | 95 | # TFS 2012 Local Workspace 96 | $tf/ 97 | 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | 101 | # ReSharper is a .NET coding add-in 102 | _ReSharper*/ 103 | *.[Rr]e[Ss]harper 104 | *.DotSettings.user 105 | 106 | # JustCode is a .NET coding add-in 107 | .JustCode 108 | 109 | # TeamCity is a build add-in 110 | _TeamCity* 111 | 112 | # DotCover is a Code Coverage Tool 113 | *.dotCover 114 | 115 | # Visual Studio code coverage results 116 | *.coverage 117 | *.coveragexml 118 | 119 | # NCrunch 120 | _NCrunch_* 121 | .*crunch*.local.xml 122 | nCrunchTemp_* 123 | 124 | # MightyMoose 125 | *.mm.* 126 | AutoTest.Net/ 127 | 128 | # Web workbench (sass) 129 | .sass-cache/ 130 | 131 | # Installshield output folder 132 | [Ee]xpress/ 133 | 134 | # DocProject is a documentation generator add-in 135 | DocProject/buildhelp/ 136 | DocProject/Help/*.HxT 137 | DocProject/Help/*.HxC 138 | DocProject/Help/*.hhc 139 | DocProject/Help/*.hhk 140 | DocProject/Help/*.hhp 141 | DocProject/Help/Html2 142 | DocProject/Help/html 143 | 144 | # Click-Once directory 145 | publish/ 146 | 147 | # Publish Web Output 148 | *.[Pp]ublish.xml 149 | *.azurePubxml 150 | # TODO: Comment the next line if you want to checkin your web deploy settings 151 | # but database connection strings (with potential passwords) will be unencrypted 152 | *.pubxml 153 | *.publishproj 154 | 155 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 156 | # checkin your Azure Web App publish settings, but sensitive information contained 157 | # in these scripts will be unencrypted 158 | PublishScripts/ 159 | 160 | # NuGet Packages 161 | *.nupkg 162 | # The packages folder can be ignored because of Package Restore 163 | **/packages/* 164 | # except build/, which is used as an MSBuild target. 165 | !**/packages/build/ 166 | # Uncomment if necessary however generally it will be regenerated when needed 167 | #!**/packages/repositories.config 168 | # NuGet v3's project.json files produces more ignoreable files 169 | *.nuget.props 170 | *.nuget.targets 171 | 172 | # Microsoft Azure Build Output 173 | csx/ 174 | *.build.csdef 175 | 176 | # Microsoft Azure Emulator 177 | ecf/ 178 | rcf/ 179 | 180 | # Windows Store app package directories and files 181 | AppPackages/ 182 | BundleArtifacts/ 183 | Package.StoreAssociation.xml 184 | _pkginfo.txt 185 | 186 | # Visual Studio cache files 187 | # files ending in .cache can be ignored 188 | *.[Cc]ache 189 | # but keep track of directories ending in .cache 190 | !*.[Cc]ache/ 191 | 192 | # Others 193 | ClientBin/ 194 | ~$* 195 | *~ 196 | *.dbmdl 197 | *.dbproj.schemaview 198 | *.jfm 199 | *.pfx 200 | *.publishsettings 201 | node_modules/ 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | 223 | # Business Intelligence projects 224 | *.rdl.data 225 | *.bim.layout 226 | *.bim_*.settings 227 | 228 | # Microsoft Fakes 229 | FakesAssemblies/ 230 | 231 | # GhostDoc plugin setting file 232 | *.GhostDoc.xml 233 | 234 | # Node.js Tools for Visual Studio 235 | .ntvs_analysis.dat 236 | 237 | # Visual Studio 6 build log 238 | *.plg 239 | 240 | # Visual Studio 6 workspace options file 241 | *.opt 242 | 243 | # Visual Studio LightSwitch build output 244 | **/*.HTMLClient/GeneratedArtifacts 245 | **/*.DesktopClient/GeneratedArtifacts 246 | **/*.DesktopClient/ModelManifest.xml 247 | **/*.Server/GeneratedArtifacts 248 | **/*.Server/ModelManifest.xml 249 | _Pvt_Extensions 250 | 251 | # Paket dependency manager 252 | .paket/paket.exe 253 | paket-files/ 254 | 255 | # FAKE - F# Make 256 | .fake/ 257 | 258 | # JetBrains Rider 259 | .idea/ 260 | *.sln.iml 261 | 262 | # CodeRush 263 | .cr/ 264 | 265 | # Python Tools for Visual Studio (PTVS) 266 | __pycache__/ 267 | *.pyc 268 | 269 | # Cake - Uncomment if you are using it 270 | # tools/ 271 | 272 | # VS Code 273 | .vscode/ -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.DockerHub.md: -------------------------------------------------------------------------------- 1 | # Supported Linux amd64 tags 2 | 3 | - [`dotnetapp-stretch`, `dotnetapp`, `latest` (*dotnetapp-prod/Dockerfile*)](https://github.com/dotnet/dotnet-docker-samples/blob/master/dotnetapp-prod/Dockerfile) 4 | 5 | # Supported Windows Server 2016 Version 1709 (Fall Creators Update) amd64 tags 6 | 7 | - [`dotnetapp-nanoserver-1709` (*dotnetapp-prod/Dockerfile*)](https://github.com/dotnet/dotnet-docker-samples/blob/master/dotnetapp-prod/Dockerfile) 8 | 9 | # Supported Windows Server 2016 amd64 tags 10 | 11 | - [`dotnetapp-nanoserver-sac2016`, `dotnetapp`, `latest` (*dotnetapp-prod/Dockerfile*)](https://github.com/dotnet/dotnet-docker-samples/blob/master/dotnetapp-prod/Dockerfile) 12 | 13 | # Supported Linux arm32 tags 14 | 15 | - [`dotnetapp-stretch-arm32v7`, `dotnetapp`, `latest` (*dotnetapp-prod/Dockerfile.arm32*)](https://github.com/dotnet/dotnet-docker-samples/blob/master/dotnetapp-prod/Dockerfile.arm32) 16 | 17 | For more information about these images and their history, please see [the relevant Dockerfile (`dotnet/dotnet-docker-samples`)](https://github.com/dotnet/dotnet-docker-samples/search?utf8=%E2%9C%93&q=FROM&type=Code). These images are updated via [pull requests to the `dotnet/dotnet-docker-samples` GitHub repo](https://github.com/dotnet/dotnet-docker-samples/pulls?utf8=%E2%9C%93&q=). 18 | 19 | # .NET Core Docker Samples 20 | 21 | This repo contains samples (one so far) that demonstrate various .NET Core Docker configurations. 22 | 23 | You can see the source for these samples at [dotnet/dotnet-docker-samples](https://github.com/dotnet/dotnet-docker-samples/tree/master) on GitHub. 24 | 25 | ## What is .NET Core? 26 | 27 | .NET Core is a general purpose development platform maintained by Microsoft and the .NET community on [GitHub](https://github.com/dotnet/core). It is cross-platform, supporting Windows, macOS and Linux, and can be used in device, cloud, and embedded/IoT scenarios. 28 | 29 | .NET has several capabilities that make development easier, including automatic memory management, (runtime) generic types, reflection, asynchrony, concurrency, and native interop. Millions of developers take advantage of these capabilities to efficiently build high-quality applications. 30 | 31 | You can use C# to write .NET Core apps. C# is simple, powerful, type-safe, and object-oriented while retaining the expressiveness and elegance of C-style languages. Anyone familiar with C and similar languages will find it straightforward to write in C#. 32 | 33 | [.NET Core](https://github.com/dotnet/core) is open source (MIT and Apache 2 licenses) and was contributed to the [.NET Foundation](http://dotnetfoundation.org) by Microsoft in 2014. It can be freely adopted by individuals and companies, including for personal, academic or commercial purposes. Multiple companies use .NET Core as part of apps, tools, new platforms and hosting services. 34 | 35 | > https://docs.microsoft.com/dotnet/core/ 36 | 37 | ![logo](https://avatars0.githubusercontent.com/u/9141961?v=3&s=100) 38 | 39 | ## How to use these Images 40 | 41 | ### Run a sample .NET Core application within a container 42 | 43 | The dotnetapp image is a sample application that depends on the [.NET Core Runtime image](https://hub.docker.com/r/microsoft/dotnet). You can run it in a container by running the following command. 44 | 45 | ```console 46 | docker run microsoft/dotnet-samples:dotnetapp 47 | ``` 48 | 49 | Note: The instructions above work for both Linux and Windows containers. The .NET Core docker images use [multi-arch tags](https://github.com/dotnet/announcements/issues/14), which abstract away different operating system choices for most use-cases. 50 | 51 | ## Image variants 52 | 53 | The `microsoft/dotnet-sample` images come in one flavor. 54 | 55 | ### `microsoft/dotnet-samples:dotnetapp` 56 | 57 | This image demonstrates the minimal use of the [.NET Core Runtime image](https://hub.docker.com/r/microsoft/dotnet). It is not intended to be used as the base of another image, but purely used for demonstration purposes. 58 | 59 | ## Related Repos 60 | 61 | See the following related repos for other application types: 62 | 63 | - [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) for .NET Core images. 64 | - [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) for ASP.NET Core images. 65 | - [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images. 66 | - [microsoft/dotnet-framework](https://hub.docker.com/r/microsoft/dotnet-framework/) for .NET Framework images (for web applications, see microsoft/aspnet). 67 | 68 | ## License 69 | 70 | View [license information](https://www.microsoft.com/net/dotnet_library_license.htm) for the software contained in this image. 71 | 72 | The .NET Core Windows container images use the same license as the [Windows Server 2016 Nano Server base image](https://hub.docker.com/r/microsoft/nanoserver/), as follows: 73 | 74 | MICROSOFT SOFTWARE SUPPLEMENTAL LICENSE TERMS 75 | 76 | CONTAINER OS IMAGE 77 | 78 | Microsoft Corporation (or based on where you live, one of its affiliates) (referenced as “us,” “we,” or “Microsoft”) licenses this Container OS Image supplement to you (“Supplement”). You are licensed to use this Supplement in conjunction with the underlying host operating system software (“Host Software”) solely to assist running the containers feature in the Host Software. The Host Software license terms apply to your use of the Supplement. You may not use it if you do not have a license for the Host Software. You may use this Supplement with each validly licensed copy of the Host Software. 79 | 80 | ## Supported Docker versions 81 | 82 | Supported Docker versions: [the latest release](https://github.com/docker/docker/releases/latest) (down to 1.12.2 on a best-effort basis) 83 | 84 | Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon. 85 | 86 | ## User Feedback 87 | 88 | ### Issues 89 | 90 | If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/dotnet/dotnet-docker-samples/issues). 91 | 92 | ### Contributing 93 | 94 | You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. 95 | 96 | Before you start to code, please read the [.NET Core contribution guidelines](https://github.com/dotnet/coreclr/blob/master/CONTRIBUTING.md). 97 | 98 | ### Documentation 99 | 100 | You can read documentation for .NET Core, including Docker usage in the [.NET Core docs](https://docs.microsoft.com/dotnet/articles/core/). The docs are [open source on GitHub](https://github.com/dotnet/core-docs). Contributions are welcome! 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The .NET Core Docker samples have moved to the [samples folder of dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker/tree/master/samples). -------------------------------------------------------------------------------- /aspnetapp/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /aspnetapp/.dockerignore: -------------------------------------------------------------------------------- 1 | bin\ 2 | obj\ 3 | out\ 4 | -------------------------------------------------------------------------------- /aspnetapp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace aspnetapp.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public IActionResult About() 17 | { 18 | ViewData["Message"] = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public IActionResult Contact() 24 | { 25 | ViewData["Message"] = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | 30 | public IActionResult Error() 31 | { 32 | return View(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /aspnetapp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/aspnetcore-build:2.0 AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | RUN dotnet restore 7 | 8 | # copy everything else and build 9 | COPY . ./ 10 | RUN dotnet publish -c Release -o out 11 | 12 | # build runtime image 13 | FROM microsoft/aspnetcore:2.0 14 | WORKDIR /app 15 | COPY --from=build-env /app/out . 16 | ENTRYPOINT ["dotnet", "aspnetapp.dll"] 17 | -------------------------------------------------------------------------------- /aspnetapp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace aspnetapp 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aspnetapp/README.md: -------------------------------------------------------------------------------- 1 | # ASP.NET Core Docker Production Sample 2 | 3 | This ASP.NET Core Docker sample demonstrates a best practice pattern for building Docker images for ASP.NET Core apps for production. The sample works with both Linux and Windows containers. 4 | 5 | The [sample Dockerfile](Dockerfile) creates an ASP.NET Core application Docker image based off of the [ASP.NET Core Runtime Docker image](https://hub.docker.com/r/microsoft/aspnetcore/). 6 | 7 | It uses the [Docker multi-stage build feature](https://github.com/dotnet/announcements/issues/18) to build the sample in a container based on the larger [ASP.NET Core Build Docker image](https://hub.docker.com/r/microsoft/aspnetcore-build/) and then copies the final build result into a Docker image based on the smaller [ASP.NET Core Docker Runtime image](https://hub.docker.com/r/microsoft/aspnetcore/). The build image contains tools that are required to build applications while the runtime image does not. 8 | 9 | This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). You need the latest Windows 10 or Windows Server 2016 to use [Windows containers](http://aka.ms/windowscontainers). The instructions assume you have the [Git](https://git-scm.com/downloads) client installed. 10 | 11 | ## Getting the sample 12 | 13 | The easiest way to get the sample is by cloning the samples repository with git, using the following instructions. 14 | 15 | ```console 16 | git clone https://github.com/dotnet/dotnet-docker-samples/ 17 | ``` 18 | 19 | You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker-samples/archive/master.zip). 20 | 21 | ## Build and run the sample with Docker for Linux containers 22 | 23 | You can build and run the sample in Docker using Linux containers using the following commands. The instructions assume that you are in the root of the repository. 24 | 25 | ```console 26 | cd aspnetapp 27 | docker build -t aspnetapp . 28 | docker run -it --rm -p 8000:80 aspnetapp 29 | ``` 30 | 31 | After the application starts, visit `http://localhost:8000` in your web browser. 32 | 33 | Note: The `-p` argument maps port 8000 on you local machine to port 80 in the container (the form of the port mapping is `host:container`). See the [Docker run reference](https://docs.docker.com/engine/reference/commandline/run/) for more information on commandline paramaters. 34 | 35 | ## Build and run the sample with Docker for Windows containers 36 | 37 | You can build and run the sample in Docker using Windows containers using the following commands. The instructions assume that you are in the root of the repository. 38 | 39 | ```console 40 | cd aspnetapp 41 | docker build -t aspnetapp . 42 | docker run -it --rm --name aspnetcore_sample aspnetapp 43 | ``` 44 | 45 | You must navigate to the container IP (as opposed to http://localhost) in your browser directly when using Windows containers. You can get the IP address of your container with the following steps: 46 | 47 | 1. Open up another command prompt. 48 | 1. Run `docker ps` to see your running containers. The "aspnetcore_sample" container should be there. 49 | 1. Run `docker exec aspnetcore_sample ipconfig`. 50 | 1. Copy the container IP address and paste into your browser (for example, `172.29.245.43`). 51 | 52 | See the following example of how to get the IP address of a running Windows container. 53 | 54 | ```console 55 | C:\git\dotnet-docker-samples\aspnetapp>docker exec aspnetcore_sample ipconfig 56 | 57 | Windows IP Configuration 58 | 59 | 60 | Ethernet adapter Ethernet: 61 | 62 | Connection-specific DNS Suffix . : contoso.com 63 | Link-local IPv6 Address . . . . . : fe80::1967:6598:124:cfa3%4 64 | IPv4 Address. . . . . . . . . . . : 172.29.245.43 65 | Subnet Mask . . . . . . . . . . . : 255.255.240.0 66 | Default Gateway . . . . . . . . . : 172.29.240.1 67 | ``` 68 | 69 | Note: [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) supports identifying containers with name or hash. The name is used above. It runs a new command (as opposed to the [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint)) in a running container. 70 | 71 | Some people prefer using `docker inspect` for this same purpose. See the following example, below: 72 | 73 | ```console 74 | C:\git\dotnet-docker-samples\aspnetapp>docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" aspnetcore_sample 75 | 172.25.157.148 76 | ``` 77 | 78 | ## Build and run the sample locally 79 | 80 | You can build and run the sample locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following commands. The commands assume that you are in the root of the repository. 81 | 82 | ```console 83 | cd aspnetapp 84 | dotnet run 85 | ``` 86 | 87 | After the application starts, visit `http://localhost:8000` in your web browser. 88 | 89 | You can produce an application that is ready to deploy to production locally using the following command. 90 | 91 | ```console 92 | dotnet publish -c release -o out 93 | ``` 94 | 95 | You can run the application on **Windows** using the following command. 96 | 97 | ```console 98 | dotnet out\aspnetapp.dll 99 | ``` 100 | 101 | You can run the application on **Linux or macOS** using the following command. 102 | 103 | ```console 104 | dotnet out/aspnetapp.dll 105 | ``` 106 | 107 | Note: The `-c release` argument builds the application in release mode (the default is debug mode). See the [dotnet run reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-run) for more information on commandline parameters. 108 | 109 | ## Docker Images used in this sample 110 | 111 | The following Docker images are used in this sample 112 | 113 | * [microsoft/aspnetcore-build:2.0](https://hub.docker.com/r/microsoft/aspnetcore-build) 114 | * [microsoft/aspnetcore:2.0](https://hub.docker.com/r/microsoft/aspnetcore/) 115 | 116 | ## Related Resources 117 | 118 | * [ASP.NET Core Getting Started Tutorials](https://www.asp.net/get-started) 119 | * [.NET Core Production Docker sample](../dotnetapp-prod/README.md) 120 | * [.NET Core Docker samples](../README.md) 121 | * [.NET Framework Docker samples](https://github.com/Microsoft/dotnet-framework-docker-samples) 122 | -------------------------------------------------------------------------------- /aspnetapp/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace aspnetapp 12 | { 13 | public class Startup 14 | { 15 | public Startup(IHostingEnvironment env) 16 | { 17 | var builder = new ConfigurationBuilder() 18 | .SetBasePath(env.ContentRootPath) 19 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 20 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) 21 | .AddEnvironmentVariables(); 22 | Configuration = builder.Build(); 23 | } 24 | 25 | public IConfigurationRoot Configuration { get; } 26 | 27 | // This method gets called by the runtime. Use this method to add services to the container. 28 | public void ConfigureServices(IServiceCollection services) 29 | { 30 | // Add framework services. 31 | services.AddMvc(); 32 | } 33 | 34 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 35 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 36 | { 37 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 38 | loggerFactory.AddDebug(); 39 | 40 | if (env.IsDevelopment()) 41 | { 42 | app.UseDeveloperExceptionPage(); 43 | app.UseBrowserLink(); 44 | } 45 | else 46 | { 47 | app.UseExceptionHandler("/Home/Error"); 48 | } 49 | 50 | app.UseStaticFiles(); 51 | 52 | app.UseMvc(routes => 53 | { 54 | routes.MapRoute( 55 | name: "default", 56 | template: "{controller=Home}/{action=Index}/{id?}"); 57 | }); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /aspnetapp/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /aspnetapp/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"].

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /aspnetapp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 67 | 68 |
69 |
70 |

Application uses

71 |
    72 |
  • Sample pages using ASP.NET Core MVC
  • 73 |
  • Bower for managing client-side libraries
  • 74 |
  • Theming using Bootstrap
  • 75 |
76 |
77 | 88 | 100 |
101 |

Run & Deploy

102 | 107 |
108 |
109 | -------------------------------------------------------------------------------- /aspnetapp/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

15 | -------------------------------------------------------------------------------- /aspnetapp/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - aspnetapp 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 40 |
41 | @RenderBody() 42 |
43 |
44 |

© 2017 - aspnetapp

45 |
46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 66 | 67 | 68 | 69 | @RenderSection("Scripts", required: false) 70 | 71 | 72 | -------------------------------------------------------------------------------- /aspnetapp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using aspnetapp 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /aspnetapp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /aspnetapp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /aspnetapp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /aspnetapp/aspnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /aspnetapp/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.7", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /aspnetapp/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Set widths on the form inputs since otherwise they're 100% wide */ 14 | input, 15 | select, 16 | textarea { 17 | max-width: 280px; 18 | } 19 | 20 | /* Carousel */ 21 | .carousel-caption p { 22 | font-size: 20px; 23 | line-height: 1.4; 24 | } 25 | 26 | /* Make .svg files in the carousel display properly in older browsers */ 27 | .carousel-inner .item img[src$=".svg"] { 28 | width: 100%; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} 2 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /aspnetapp/wwwroot/images/banner1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/images/banner2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/images/banner3.svg: -------------------------------------------------------------------------------- 1 | banner3b -------------------------------------------------------------------------------- /aspnetapp/wwwroot/images/banner4.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-docker-samples/ce1a2034f0edc77a79966a2edcdd66cbdf2b30d0/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /aspnetapp/wwwroot/lib/jquery-validation/dist/additional-methods.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;ec;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c Open -> File) or double-click on the TRX file (if you have Visual Studio installed). There are other TRX file viewers available as well that you can search for. 88 | 89 | ![Visual Studio Test Results](https://user-images.githubusercontent.com/2608468/35361940-2f5ab914-0118-11e8-9c40-4f252f4568f0.png) 90 | 91 | The unit testing in this Dockerfile demonstrates a couple approaches to unit testing with Docker. If you adopt this Dockerfile, you don't need to use both or either of these approaches. They are patterns that we considered useful for the unit testing use case. 92 | 93 | ## Build and run the sample locally 94 | 95 | You can build and run the sample locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following instructions. The instructions assume that you are in the root of the repository. 96 | 97 | ```console 98 | cd dotnetapp-dev 99 | dotnet run Hello .NET Core 100 | ``` 101 | 102 | You can produce an application that is ready to deploy to production locally using the following command. 103 | 104 | ```console 105 | dotnet publish -c release -o out 106 | ``` 107 | 108 | You can run the application on **Windows** using the following command. 109 | 110 | ```console 111 | dotnet out\dotnetapp.dll 112 | ``` 113 | 114 | You can run the application on **Linux or macOS** using the following command. 115 | 116 | ```console 117 | dotnet out/dotnetapp.dll 118 | ``` 119 | 120 | Note: The `-c release` argument builds the application in release mode (the default is debug mode). See the [dotnet run reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-run) for more information on commandline parameters. 121 | 122 | ## Docker Images used in this sample 123 | 124 | The following Docker images are used in this sample 125 | 126 | * [microsoft/dotnet:2.0-sdk](https://hub.docker.com/r/microsoft/dotnet) 127 | * [microsoft/dotnet:2.0-runtime](https://hub.docker.com/r/microsoft/dotnet) 128 | 129 | ## Related Resources 130 | 131 | * [.NET Core Docker samples](../README.md) 132 | * [.NET Framework Docker samples](https://github.com/Microsoft/dotnet-framework-docker-samples) 133 | -------------------------------------------------------------------------------- /dotnetapp-dev/dotnetapp-dev.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 15 3 | VisualStudioVersion = 15.0.27130.2024 4 | MinimumVisualStudioVersion = 15.0.26124.0 5 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetapp", "dotnetapp\dotnetapp.csproj", "{694D3029-F31E-4945-8972-557A899D5CDD}" 6 | EndProject 7 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "utils", "utils\utils.csproj", "{39530D58-BE7D-49CC-A0B0-D3502631DF7E}" 8 | EndProject 9 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tests", "tests\tests.csproj", "{150F5901-62BF-4F37-B3E7-6A61C73ACFB1}" 10 | EndProject 11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{90F9D14D-E209-4E8D-962B-B1FD13751A74}" 12 | ProjectSection(SolutionItems) = preProject 13 | .dockerignore = .dockerignore 14 | Dockerfile = Dockerfile 15 | README.md = README.md 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Debug|x64 = Debug|x64 22 | Debug|x86 = Debug|x86 23 | Release|Any CPU = Release|Any CPU 24 | Release|x64 = Release|x64 25 | Release|x86 = Release|x86 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|x64.ActiveCfg = Debug|Any CPU 31 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|x64.Build.0 = Debug|Any CPU 32 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|x86.ActiveCfg = Debug|Any CPU 33 | {694D3029-F31E-4945-8972-557A899D5CDD}.Debug|x86.Build.0 = Debug|Any CPU 34 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|x64.ActiveCfg = Release|Any CPU 37 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|x64.Build.0 = Release|Any CPU 38 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|x86.ActiveCfg = Release|Any CPU 39 | {694D3029-F31E-4945-8972-557A899D5CDD}.Release|x86.Build.0 = Release|Any CPU 40 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|x64.ActiveCfg = Debug|Any CPU 43 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|x64.Build.0 = Debug|Any CPU 44 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|x86.ActiveCfg = Debug|Any CPU 45 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Debug|x86.Build.0 = Debug|Any CPU 46 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|x64.ActiveCfg = Release|Any CPU 49 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|x64.Build.0 = Release|Any CPU 50 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|x86.ActiveCfg = Release|Any CPU 51 | {39530D58-BE7D-49CC-A0B0-D3502631DF7E}.Release|x86.Build.0 = Release|Any CPU 52 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|x64.ActiveCfg = Debug|Any CPU 55 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|x64.Build.0 = Debug|Any CPU 56 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|x86.ActiveCfg = Debug|Any CPU 57 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Debug|x86.Build.0 = Debug|Any CPU 58 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|Any CPU.Build.0 = Release|Any CPU 60 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|x64.ActiveCfg = Release|Any CPU 61 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|x64.Build.0 = Release|Any CPU 62 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|x86.ActiveCfg = Release|Any CPU 63 | {150F5901-62BF-4F37-B3E7-6A61C73ACFB1}.Release|x86.Build.0 = Release|Any CPU 64 | EndGlobalSection 65 | GlobalSection(SolutionProperties) = preSolution 66 | HideSolutionNode = FALSE 67 | EndGlobalSection 68 | GlobalSection(ExtensibilityGlobals) = postSolution 69 | SolutionGuid = {8EED988E-EEFE-4B46-8C27-B94B69544AAC} 70 | EndGlobalSection 71 | EndGlobal 72 | -------------------------------------------------------------------------------- /dotnetapp-dev/dotnetapp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using Utils; 4 | using static System.Console; 5 | 6 | public static class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | string message = "Dotnet-bot: Welcome to using .NET Core!"; 11 | 12 | if (args.Length > 0) 13 | { 14 | message = String.Join(" ",args); 15 | } 16 | 17 | var reversedString = $"Reversed string: {ReverseUtil.ReverseString(message)}"; 18 | WriteLine(GetBot(reversedString)); 19 | WriteLine("**Environment**"); 20 | WriteLine($"Platform: .NET Core 2.0"); 21 | WriteLine($"OS: {RuntimeInformation.OSDescription}"); 22 | WriteLine(); 23 | } 24 | 25 | public static string GetBot(string message) 26 | { 27 | string bot = $"\n {message}"; 28 | bot += @" 29 | __________________ 30 | \ 31 | \ 32 | .... 33 | ....' 34 | .... 35 | .......... 36 | .............'..'.. 37 | ................'..'..... 38 | .......'..........'..'..'.... 39 | ........'..........'..'..'..... 40 | .'....'..'..........'..'.......'. 41 | .'..................'... ...... 42 | . ......'......... ..... 43 | . ...... 44 | .. . .. ...... 45 | .... . ....... 46 | ...... ....... ............ 47 | ................ ...................... 48 | ........................'................ 49 | ......................'..'...... ....... 50 | .........................'..'..... ....... 51 | ........ ..'.............'..'.... .......... 52 | ..'..'... ...............'....... .......... 53 | ...'...... ...... .......... ...... ....... 54 | ........... ....... ........ ...... 55 | ....... '...'.'. '.'.'.' .... 56 | ....... .....'.. ..'..... 57 | .. .......... ..'........ 58 | ............ .............. 59 | ............. '.............. 60 | ...........'.. .'.'............ 61 | ............... .'.'............. 62 | .............'.. ..'..'........... 63 | ............... .'.............. 64 | ......... .............. 65 | ..... 66 | 67 | "; 68 | return bot; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /dotnetapp-dev/dotnetapp/dotnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dotnetapp-dev/tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | using Utils; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTest1 8 | { 9 | [Fact] 10 | public void Test1() 11 | { 12 | var inputString = "Dotnet-bot: Welcome to using .NET Core!"; 13 | var expectedString = "!eroC TEN. gnisu ot emocleW :tob-tentoD"; 14 | var actualString = ReverseUtil.ReverseString(inputString); 15 | Assert.True(actualString == expectedString, "The input string was not reversed correctly."); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dotnetapp-dev/tests/tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dotnetapp-dev/utils/ReverseUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utils 4 | { 5 | public static class ReverseUtil 6 | { 7 | public static string ReverseString(string input) 8 | { 9 | var chars = input.ToCharArray(); 10 | Array.Reverse(chars); 11 | var reversedString = new string(chars); 12 | return reversedString; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /dotnetapp-dev/utils/utils.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/.dockerignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | out/ 4 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet-nightly:2.1-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | COPY NuGet.config ./ 7 | RUN dotnet restore 8 | 9 | # copy everything else and build 10 | COPY . ./ 11 | RUN dotnet publish -c Release -o out --no-restore 12 | 13 | 14 | # build runtime image 15 | FROM microsoft/dotnet-nightly:2.1-runtime-alpine 16 | WORKDIR /app 17 | COPY --from=build-env /app/out ./ 18 | ENTRYPOINT ["dotnet", "dotnetapp.dll"] 19 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/Dockerfile.globalization: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet-nightly:2.1-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | COPY NuGet.config ./ 7 | RUN dotnet restore 8 | 9 | # copy everything else and build 10 | COPY . ./ 11 | RUN dotnet publish -c Release -o out --no-restore 12 | 13 | 14 | # build runtime image 15 | FROM microsoft/dotnet-nightly:2.1-runtime-alpine 16 | 17 | ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false 18 | RUN apk add --no-cache icu-libs 19 | 20 | ENV LC_ALL en_US.UTF-8 21 | ENV LANG en_US.UTF-8 22 | 23 | WORKDIR /app 24 | COPY --from=build-env /app/out ./ 25 | ENTRYPOINT ["dotnet", "dotnetapp.dll"] 26 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Globalization; 5 | using static System.Console; 6 | 7 | public static class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | string message = "Dotnet-bot: Welcome to using .NET Core!"; 12 | 13 | if (args.Length > 0) 14 | { 15 | message = String.Join(" ", args); 16 | } 17 | 18 | WriteLine(GetBot(message)); 19 | WriteLine("**Environment**"); 20 | WriteLine($"Platform: .NET Core 2.0"); 21 | WriteLine($"OS: {RuntimeInformation.OSDescription}"); 22 | WriteLine($"Culture: {CultureInfo.CurrentCulture.DisplayName}"); 23 | WriteLine(); 24 | } 25 | 26 | public static string GetBot(string message) 27 | { 28 | string bot = $"\n {message}"; 29 | bot += @" 30 | __________________ 31 | \ 32 | \ 33 | .... 34 | ....' 35 | .... 36 | .......... 37 | .............'..'.. 38 | ................'..'..... 39 | .......'..........'..'..'.... 40 | ........'..........'..'..'..... 41 | .'....'..'..........'..'.......'. 42 | .'..................'... ...... 43 | . ......'......... ..... 44 | . ...... 45 | .. . .. ...... 46 | .... . ....... 47 | ...... ....... ............ 48 | ................ ...................... 49 | ........................'................ 50 | ......................'..'...... ....... 51 | .........................'..'..... ....... 52 | ........ ..'.............'..'.... .......... 53 | ..'..'... ...............'....... .......... 54 | ...'...... ...... .......... ...... ....... 55 | ........... ....... ........ ...... 56 | ....... '...'.'. '.'.'.' .... 57 | ....... .....'.. ..'..... 58 | .. .......... ..'........ 59 | ............ .............. 60 | ............. '.............. 61 | ...........'.. .'.'............ 62 | ............... .'.'............. 63 | .............'.. ..'..'........... 64 | ............... .'.............. 65 | ......... .............. 66 | ..... 67 | 68 | "; 69 | return bot; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/README.md: -------------------------------------------------------------------------------- 1 | # .NET Core Docker Alpine Production Sample (Preview) 2 | 3 | This .NET Core Docker sample demonstrates a best practice pattern for building Alpine based Docker images for .NET Core apps for production. 4 | 5 | The primary goal of Alpine is very small deployments. Images can be pulled quicker and will have a smaller attack surface area. The .NET Core Alpine Docker images are currently in preview. See the [.NET Core Alpine Docker Image announcement](https://github.com/dotnet/dotnet-docker-nightly/issues/500) for additional details. 6 | 7 | The [sample Dockerfile](Dockerfile) creates a .NET Core application Docker image based off of the [.NET Core Runtime Alpine Preview Docker image](https://hub.docker.com/r/microsoft/dotnet-nightly/). 8 | 9 | It uses the [Docker multi-stage build feature](https://github.com/dotnet/announcements/issues/18) to build the sample in a container based on the larger [.NET Core SDK Docker image](https://hub.docker.com/r/microsoft/dotnet/) and then copies the final build result into a Docker image based on the smaller [.NET Core Docker Runtime image](https://hub.docker.com/r/microsoft/dotnet/). The SDK image contains tools that are required to build applications while the runtime image does not. 10 | 11 | This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). You need the latest Windows 10 or Windows Server 2016 to use [Windows containers](http://aka.ms/windowscontainers). The instructions assume you have the [Git](https://git-scm.com/downloads) client installed. 12 | 13 | ## Getting the sample 14 | 15 | The easiest way to get the sample is by cloning the samples repository with git, using the following instructions. 16 | 17 | ```console 18 | git clone https://github.com/dotnet/dotnet-docker-samples/ 19 | ``` 20 | 21 | You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker-samples/archive/master.zip). 22 | 23 | ## Build and run the sample with Docker 24 | 25 | You can build and run the sample in Docker using the following commands. The instructions assume that you are in the root of the repository. 26 | 27 | ```console 28 | cd dotnetapp-prod-alpine-preview 29 | docker build -t dotnetapp-prod-alpine-preview . 30 | docker run --rm dotnetapp-prod-alpine-preview Hello .NET Core from Docker 31 | ``` 32 | 33 | Note: The instructions above work only with Linux containers. 34 | 35 | ## Build and run the sample without the Globalization Invariant Mode 36 | 37 | The Alpine based .NET Core Runtime Docker image has the [.NET Core 2.0 Globalization Invariant Mode](https://github.com/dotnet/announcements/issues/20) enabled in order to reduce the default size of the image. Use cases that cannot tolerate Globalization Invariant Mode can reset the `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` environment variable and install the required ICU package. The [Globalization Dockerfile](Dockerfile.globalization) illustrates how this can be done. 38 | 39 | You can build and run the sample in Docker using the following commands. The instructions assume that you are in the root of the repository. 40 | 41 | ```console 42 | cd dotnetapp-prod-alpine-preview 43 | docker build -t dotnetapp-prod-alpine-preview -f Dockerfile.globalization . 44 | docker run --rm dotnetapp-prod-alpine-preview Hello .NET Core from Docker 45 | ``` 46 | 47 | Note: The instructions above work only with Linux containers. 48 | 49 | ## Docker Images used in this sample 50 | 51 | The following Docker images are used in this sample 52 | 53 | * [microsoft/dotnet-nightly:2.1-sdk](https://hub.docker.com/r/microsoft/dotnet-nightly) 54 | * [microsoft/dotnet-nightly:2.1-runtime-alpine](https://hub.docker.com/r/microsoft/dotnet-nightly) 55 | 56 | ## Related Resources 57 | 58 | * [ASP.NET Core Production Docker sample](../aspnetapp/README.md) 59 | * [.NET Core Docker samples](../README.md) 60 | * [.NET Framework Docker samples](https://github.com/Microsoft/dotnet-framework-docker-samples) 61 | -------------------------------------------------------------------------------- /dotnetapp-prod-alpine-preview/dotnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Exe 6 | netcoreapp2.1 7 | 2.1.0-preview1-25919-02 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /dotnetapp-prod/.dockerignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | out/ 4 | -------------------------------------------------------------------------------- /dotnetapp-prod/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet:2.0-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | RUN dotnet restore 7 | 8 | # copy everything else and build 9 | COPY . ./ 10 | RUN dotnet publish -c Release -o out 11 | 12 | # build runtime image 13 | FROM microsoft/dotnet:2.0-runtime 14 | WORKDIR /app 15 | COPY --from=build-env /app/out ./ 16 | ENTRYPOINT ["dotnet", "dotnetapp.dll"] 17 | -------------------------------------------------------------------------------- /dotnetapp-prod/Dockerfile.arm32: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet:2.0-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | RUN dotnet restore 7 | 8 | # copy everything else and build 9 | COPY . ./ 10 | RUN dotnet publish -c Release -o out 11 | 12 | # build runtime image 13 | FROM microsoft/dotnet:2.0.0-runtime-stretch-arm32v7 14 | WORKDIR /app 15 | COPY --from=build-env /app/out ./ 16 | ENTRYPOINT ["dotnet", "dotnetapp.dll"] 17 | -------------------------------------------------------------------------------- /dotnetapp-prod/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using static System.Console; 4 | 5 | public static class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | string message = "Dotnet-bot: Welcome to using .NET Core!"; 10 | 11 | if (args.Length > 0) 12 | { 13 | message = String.Join(" ",args); 14 | } 15 | 16 | WriteLine(GetBot(message)); 17 | WriteLine("**Environment**"); 18 | WriteLine($"Platform: .NET Core 2.0"); 19 | WriteLine($"OS: {RuntimeInformation.OSDescription}"); 20 | WriteLine(); 21 | } 22 | 23 | public static string GetBot(string message) 24 | { 25 | string bot = $"\n {message}"; 26 | bot += @" 27 | __________________ 28 | \ 29 | \ 30 | .... 31 | ....' 32 | .... 33 | .......... 34 | .............'..'.. 35 | ................'..'..... 36 | .......'..........'..'..'.... 37 | ........'..........'..'..'..... 38 | .'....'..'..........'..'.......'. 39 | .'..................'... ...... 40 | . ......'......... ..... 41 | . ...... 42 | .. . .. ...... 43 | .... . ....... 44 | ...... ....... ............ 45 | ................ ...................... 46 | ........................'................ 47 | ......................'..'...... ....... 48 | .........................'..'..... ....... 49 | ........ ..'.............'..'.... .......... 50 | ..'..'... ...............'....... .......... 51 | ...'...... ...... .......... ...... ....... 52 | ........... ....... ........ ...... 53 | ....... '...'.'. '.'.'.' .... 54 | ....... .....'.. ..'..... 55 | .. .......... ..'........ 56 | ............ .............. 57 | ............. '.............. 58 | ...........'.. .'.'............ 59 | ............... .'.'............. 60 | .............'.. ..'..'........... 61 | ............... .'.............. 62 | ......... .............. 63 | ..... 64 | 65 | "; 66 | return bot; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /dotnetapp-prod/README.md: -------------------------------------------------------------------------------- 1 | # .NET Core Docker Production Sample 2 | 3 | This .NET Core Docker sample demonstrates a best practice pattern for building Docker images for .NET Core apps for production. The sample works with both Linux and Windows containers. 4 | 5 | The [sample Dockerfile](Dockerfile) creates a .NET Core application Docker image based off of the [.NET Core Runtime Docker image](https://hub.docker.com/r/microsoft/dotnet/). 6 | 7 | It uses the [Docker multi-stage build feature](https://github.com/dotnet/announcements/issues/18) to build the sample in a container based on the larger [.NET Core SDK Docker image](https://hub.docker.com/r/microsoft/dotnet/) and then copies the final build result into a Docker image based on the smaller [.NET Core Docker Runtime image](https://hub.docker.com/r/microsoft/dotnet/). The SDK image contains tools that are required to build applications while the runtime image does not. 8 | 9 | This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). You need the latest Windows 10 or Windows Server 2016 to use [Windows containers](http://aka.ms/windowscontainers). The instructions assume you have the [Git](https://git-scm.com/downloads) client installed. 10 | 11 | ## Getting the sample 12 | 13 | The easiest way to get the sample is by cloning the samples repository with git, using the following instructions. 14 | 15 | ```console 16 | git clone https://github.com/dotnet/dotnet-docker-samples/ 17 | ``` 18 | 19 | You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker-samples/archive/master.zip). 20 | 21 | ## Build and run the sample with Docker 22 | 23 | You can build and run the sample in Docker using the following commands. The instructions assume that you are in the root of the repository. 24 | 25 | ```console 26 | cd dotnetapp-prod 27 | docker build -t dotnetapp-prod . 28 | docker run --rm dotnetapp-prod Hello .NET Core from Docker 29 | ``` 30 | 31 | Note: The instructions above work for both Linux and Windows containers. The .NET Core docker images use [multi-arch tags](https://github.com/dotnet/announcements/issues/14), which abstract away different operating system choices for most use-cases. 32 | 33 | ## Build on Windows or macOS and run the sample with Docker on Linux + ARM32 (Raspberry Pi) 34 | 35 | The goal of this section is to create and run a Docker .NET Core runtime-based image on a Raspberry Pi running Linux. The .NET Core SDK does not run on the Linux + ARM32 configuration. As a result, the instructions used for X64 don't work. There are multiple ways to get around this limitation, primarily: 36 | 37 | * Build app on X64 and copy via scp (or pscp) to ARM32 device and then build and run a Docker runtime image on the ARM32 device, or 38 | * Build final ARM32 image on Windows, push image to a Docker registry and then pull and run from the ARM32 device. 39 | 40 | The second option is only supported on Windows. Linux and macOS user must use the first option. For simplicity, the Windows option is provided below. 41 | 42 | The instructions assume that you are in the root of the repository. 43 | 44 | Type the following commands in Docker "Linux mode" on Windows. The instructions assume that you have a personal Docker user account called `mydockername`. You will need to change that to your actual docker account name, such as [richlander](https://hub.docker.com/u/richlander/) in the case of the author of this sample. You will also need to create a Docker repo called `dotnetapp-prod-arm32`. You can create new repos in the Docker web UI. 45 | 46 | You need to be signed into the Docker client to `docker push` to Docker Hub. 47 | 48 | ```console 49 | cd dotnetapp-prod 50 | docker build -t mydockername/dotnetapp-prod-arm32 -f Dockerfile.arm32 . 51 | docker push mydockername/dotnetapp-prod-arm32 52 | ``` 53 | 54 | Switch to your Raspberry Pi, with Linux and Docker installed. Type the following command. 55 | 56 | ```console 57 | docker run --rm mydockername/dotnetapp-prod-arm32 Hello .NET Core from Docker 58 | ``` 59 | 60 | ## Build and run the sample locally 61 | 62 | You can build and run the sample locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following instructions. The instructions assume that you are in the root of the repository. 63 | 64 | ```console 65 | cd dotnetapp-prod 66 | dotnet run Hello .NET Core 67 | ``` 68 | 69 | You can produce an application that is ready to deploy to production locally using the following command. 70 | 71 | ```console 72 | dotnet publish -c release -o out 73 | ``` 74 | 75 | You can run the application on **Windows** using the following command. 76 | 77 | ```console 78 | dotnet out\dotnetapp.dll 79 | ``` 80 | 81 | You can run the application on **Linux or macOS** using the following command. 82 | 83 | ```console 84 | dotnet out/dotnetapp.dll 85 | ``` 86 | 87 | Note: The `-c release` argument builds the application in release mode (the default is debug mode). See the [dotnet run reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-run) for more information on commandline parameters. 88 | 89 | ## Docker Images used in this sample 90 | 91 | The following Docker images are used in this sample 92 | 93 | * [microsoft/dotnet:2.0-sdk](https://hub.docker.com/r/microsoft/dotnet) 94 | * [microsoft/dotnet:2.0-runtime](https://hub.docker.com/r/microsoft/dotnet) 95 | 96 | ## Related Resources 97 | 98 | * [ASP.NET Core Production Docker sample](../aspnetapp/README.md) 99 | * [.NET Core Docker samples](../README.md) 100 | * [.NET Framework Docker samples](https://github.com/Microsoft/dotnet-framework-docker-samples) 101 | -------------------------------------------------------------------------------- /dotnetapp-prod/dotnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/.dockerignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | out/ 4 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet:2.0-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY nuget.config ./ 6 | COPY *.csproj ./ 7 | RUN dotnet restore 8 | 9 | # copy everything else and build 10 | COPY . ./ 11 | RUN dotnet publish -c Release -r linux-x64 -o out 12 | 13 | # build runtime image 14 | FROM microsoft/dotnet:2.0-runtime-deps 15 | WORKDIR /app 16 | COPY --from=build-env /app/out ./ 17 | ENTRYPOINT ["./dotnetapp"] 18 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/Dockerfile.arm32: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet:2.0-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY nuget.config ./ 6 | COPY *.csproj ./ 7 | RUN dotnet restore 8 | 9 | # copy everything else and build 10 | COPY . ./ 11 | RUN dotnet publish -c Release -r linux-arm -o out 12 | 13 | # build runtime image 14 | FROM microsoft/dotnet:2.0.0-runtime-stretch-arm32v7 15 | WORKDIR /app 16 | COPY --from=build-env /app/out ./ 17 | ENTRYPOINT ["dotnet", "dotnetapp.dll"] 18 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/Dockerfile.nano: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet:2.0-sdk AS build-env 2 | WORKDIR /app 3 | 4 | # copy csproj and restore as distinct layers 5 | COPY nuget.config ./ 6 | COPY *.csproj ./ 7 | RUN dotnet restore 8 | 9 | # copy everything else and build 10 | COPY . ./ 11 | RUN dotnet publish -c Release -r win-x64 -o out 12 | 13 | # build runtime image 14 | FROM microsoft/nanoserver:sac2016 15 | WORKDIR /app 16 | COPY --from=build-env /app/out ./ 17 | ENTRYPOINT ["dotnetapp.exe"] 18 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using static System.Console; 4 | 5 | public static class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | string message = "Dotnet-bot: Welcome to using .NET Core!"; 10 | 11 | if (args.Length > 0) 12 | { 13 | message = String.Join(" ",args); 14 | } 15 | 16 | WriteLine(GetBot(message)); 17 | WriteLine("**Environment**"); 18 | WriteLine($"Platform: .NET Core 2.0"); 19 | WriteLine($"OS: {RuntimeInformation.OSDescription}"); 20 | WriteLine(); 21 | } 22 | 23 | public static string GetBot(string message) 24 | { 25 | string bot = $"\n {message}"; 26 | bot += @" 27 | __________________ 28 | \ 29 | \ 30 | .... 31 | ....' 32 | .... 33 | .......... 34 | .............'..'.. 35 | ................'..'..... 36 | .......'..........'..'..'.... 37 | ........'..........'..'..'..... 38 | .'....'..'..........'..'.......'. 39 | .'..................'... ...... 40 | . ......'......... ..... 41 | . ...... 42 | .. . .. ...... 43 | .... . ....... 44 | ...... ....... ............ 45 | ................ ...................... 46 | ........................'................ 47 | ......................'..'...... ....... 48 | .........................'..'..... ....... 49 | ........ ..'.............'..'.... .......... 50 | ..'..'... ...............'....... .......... 51 | ...'...... ...... .......... ...... ....... 52 | ........... ....... ........ ...... 53 | ....... '...'.'. '.'.'.' .... 54 | ....... .....'.. ..'..... 55 | .. .......... ..'........ 56 | ............ .............. 57 | ............. '.............. 58 | ...........'.. .'.'............ 59 | ............... .'.'............. 60 | .............'.. ..'..'........... 61 | ............... .'.............. 62 | ......... .............. 63 | ..... 64 | 65 | "; 66 | return bot; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/README.md: -------------------------------------------------------------------------------- 1 | # .NET Core self-contained application Docker Production Sample 2 | 3 | This .NET Core Docker sample demonstrates a best practice pattern for building Docker images for [self-contained .NET Core applications](https://docs.microsoft.com/dotnet/core/deploying/). This is the type of image you would want to use if you want the smallest possible container in production and do not see a [benefit from sharing .NET images between containers](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/) (you would still potentially share lower Docker layers). The sample works with both Linux and Windows containers. 4 | 5 | This [sample Dockerfile for Linux](Dockerfile) creates an .NET Core application image based off the [.NET Core Runtime Dependencies Docker image](https://hub.docker.com/r/microsoft/dotnet/), which is based on [Debian 9 (Stretch) base image](https://hub.docker.com/_/debian/). 6 | 7 | This [sample Dockerfile for Windows Nanoserver](Dockerfile.nano) creates a .NET Core application image based off the [Windows Nanoserver base image](https://hub.docker.com/r/microsoft/nanoserver/). 8 | 9 | The sample uses the [Docker multi-stage build feature](https://github.com/dotnet/announcements/issues/18) for Linux and Windows to build the sample in a container based on the larger [.NET Core SDK Docker image](https://hub.docker.com/r/microsoft/dotnet/) and then copies the final build result into a smaller Docker image based on the appropriate image mentioned above (based whether you are using Windows or Linux containers). 10 | 11 | This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). You need the latest Windows 10 or Windows Server 2016 to use [Windows containers](http://aka.ms/windowscontainers). The instructions assume you have the [Git](https://git-scm.com/downloads) client installed. 12 | 13 | ## Getting the sample 14 | 15 | The easiest way to get the sample is by cloning the samples repository with git, using the following instructions. 16 | 17 | ```console 18 | git clone https://github.com/dotnet/dotnet-docker-samples/ 19 | ``` 20 | 21 | You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker-samples/archive/master.zip). 22 | 23 | ## Producing small applications with the .NET Linker 24 | 25 | The sample uses an [experimental linker](https://github.com/dotnet/core/blob/master/samples/linker-instructions.md) for removing code that your final application does not need. The linker helps to produce Docker images that are significantly smaller. The [linker](https://dotnet.myget.org/feed/dotnet-core/package/nuget/Illink.Tasks) is not required and can be [removed](https://github.com/dotnet/dotnet-docker-samples/blob/master/dotnetapp-selfcontained/dotnetapp.csproj#L7) from the sample or [disabled on the commandline](https://github.com/dotnet/core/blob/master/samples/linker-instructions.md#linker-switches) if you do not want to use it. 26 | 27 | ## Build and run the sample with Docker for Linux containers 28 | 29 | You can build and run the sample in Docker using Linux containers using the following commands. The instructions assume that you are in the root of the repository. 30 | 31 | ```console 32 | cd dotnetapp-selfcontained 33 | docker build -t dotnetapp-selfcontained . 34 | docker run --rm dotnetapp-selfcontained Hello .NET Core from Docker 35 | ``` 36 | 37 | ## Build and run the sample with Docker for Windows containers 38 | 39 | You can build and run the sample in Docker using Windows containers using the following commands. The instructions assume that you are in the root of the repository. 40 | 41 | ```console 42 | cd dotnetapp-selfcontained 43 | docker build -t dotnetapp-selfcontained -f Dockerfile.nano . 44 | docker run dotnetapp-selfcontained Hello .NET Core from Docker 45 | ``` 46 | 47 | ## Build on Windows or macOS and run the sample with Docker on Linux + ARM32 (Raspberry Pi) 48 | 49 | The goal of this section is to create and run a Docker .NET Core runtime-based image on a Raspberry Pi running Linux. The .NET Core SDK does not run on the Linux + ARM32 configuration. As a result, the instructions used for X64 don't work. There are multiple ways to get around this limitation, primarily: 50 | 51 | * Build final ARM32 image on Windows, push image to a Docker registry and then pull and run from the ARM32 device, or 52 | * Build app on X64 and copy via scp (or pscp) to ARM32 device and then build and run a Docker runtime image on the ARM32 device 53 | 54 | The first option is only supported on Windows and macOS. Linux users must use the second option. For simplicity, the first option is provided below. 55 | 56 | The instructions assume that you are in the root of the repository. 57 | 58 | Type the following commands in Docker "Linux mode" on Windows. The instructions assume that you have a personal Docker user account called `mydockername`. You will need to change that to your actual docker account name, such as [richlander](https://hub.docker.com/u/richlander/) in the case of the author of this sample. You will also need to create a Docker repo called `dotnetapp-selfcontained-arm32`. You can create new repos in the Docker web UI. 59 | 60 | You need to be signed into the Docker client to `docker push` to Docker Hub. 61 | 62 | ```console 63 | cd dotnetapp-selfcontained 64 | docker build -t mydockername/dotnetapp-selfcontained-arm32 -f Dockerfile.arm32 . 65 | docker push mydockername/dotnetapp-selfcontained-arm32 66 | ``` 67 | 68 | Switch to your Raspberry Pi, with Linux and Docker installed. Type the following command. 69 | 70 | ```console 71 | docker run --rm mydockername/dotnetapp-selfcontained-arm32 Hello .NET Core from Docker 72 | ``` 73 | 74 | ## Build, Run and Publish the sample locally 75 | 76 | You can build and run the sample locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following instructions. The instructions assume that you are in the root of the repository. 77 | 78 | ```console 79 | cd dotnetapp-selfcontained 80 | dotnet run 81 | ``` 82 | 83 | ### Publishing on Windows 84 | 85 | You can publish an application locally that is ready to deploy to production using the following commands. 86 | 87 | ```console 88 | dotnet publish -c release -r win-x64 -o selfcontained-win-x64 89 | selfcontained-win-x64\dotnetapp.exe 90 | ``` 91 | 92 | Note: The `-c release` argument builds the application in release mode (the default is debug mode). See the [dotnet run reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-run) for more information on commandline parameters. 93 | 94 | ### Publishing on Linux 95 | 96 | You can publish an application locally that is ready to deploy to production using the following commands. 97 | 98 | ```console 99 | dotnet publish -c release -r linux-x64 -o selfcontained-linux-x64 100 | ./selfcontained-linux-x64/dotnetapp 101 | ``` 102 | 103 | Note: The `-r` argument specifies which runtime target the application should be built and published for. See the [dotnet run reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-run) for more information on commandline parameters. 104 | 105 | Note: You can publish for other architectures with .NET Core. For example, you can publish for `linux-x64` on Windows or macOS. You can use the `linux-arm` runtime ID you are targeting the Raspberry Pi on Linux, for example. 106 | 107 | ### Publishing on macOS 108 | 109 | You can publish an application locally that is ready to deploy to production using the following commands. 110 | 111 | ```console 112 | dotnet publish -c release -r osx-x64 -o selfcontained-osx-x64 113 | ./selfcontained-osx-x64/dotnetapp 114 | ``` 115 | 116 | ## Docker Images used in this sample 117 | 118 | The following Docker images are used in this sample 119 | 120 | * [microsoft/dotnet:2.0-sdk](https://hub.docker.com/r/microsoft/dotnet) 121 | * [microsoft/dotnet:2.0-runtime-deps](https://hub.docker.com/r/microsoft/dotnet) 122 | * [microsoft/nanoserver](https://hub.docker.com/r/microsoft/nanoserver) 123 | 124 | ## Related Resources 125 | 126 | * [Self-contained .NET Core applications](https://docs.microsoft.com/dotnet/core/deploying/) 127 | * [ASP.NET Core Production Docker sample](../aspnetapp/README.md) 128 | * [.NET Core Production Docker sample](../dotnetapp-prod/README.md) 129 | * [.NET Core Docker samples](../README.md) 130 | * [.NET Framework Docker samples](https://github.com/Microsoft/dotnet-framework-docker-samples) 131 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/dotnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dotnetapp-selfcontained/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "repos": [ 3 | { 4 | "name": "microsoft/dotnet-samples", 5 | "readmePath": "README.DockerHub.md", 6 | "images": [ 7 | { 8 | "sharedTags": { 9 | "dotnetapp": {}, 10 | "latest": {} 11 | }, 12 | "platforms": [ 13 | { 14 | "dockerfile": "dotnetapp-prod/Dockerfile", 15 | "os": "linux", 16 | "tags": { 17 | "dotnetapp-stretch": {} 18 | } 19 | }, 20 | { 21 | "dockerfile": "dotnetapp-prod/Dockerfile", 22 | "os": "windows", 23 | "osVersion": "10.0.14393", 24 | "tags": { 25 | "dotnetapp-nanoserver-sac2016": {} 26 | } 27 | }, 28 | { 29 | "dockerfile": "dotnetapp-prod/Dockerfile", 30 | "os": "windows", 31 | "osVersion": "10.0.16299", 32 | "tags": { 33 | "dotnetapp-nanoserver-1709": {} 34 | } 35 | }, 36 | { 37 | "architecture": "arm", 38 | "dockerfile": "dotnetapp-prod/Dockerfile.arm32", 39 | "os": "linux", 40 | "tags": { 41 | "dotnetapp-stretch-arm32v7": {} 42 | } 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | ] 49 | } 50 | --------------------------------------------------------------------------------