I always use docker to run or publish my applications. It makes life so easy to build, publish and update applications on servers. # Example files I uploaded all example files in to my [GitHub Repository](https://github.com/tomas-petrauskas/dockerize-netcore). # Sample Application Use sample code to create .NET Core Web Application   # Docker Ignore To build an application we only need Source Code, let's ignore unnecessary files like *./obj* or *./bin*. # Dockerfile We will use Microsoft official [SDK](https://hub.docker.com/_/microsoft-dotnet-core-sdk/) and [Runtime](https://hub.docker.com/_/microsoft-dotnet-core-aspnet/) Docker Containers to Build and Run .NET Core Application. This will make Application Container lighter since it will not include Source Code, only artifacts and libraries etc. Please replace Application name if needed. # Build Build Docker Container from *Dockerfile* file in current directory: `docker build -t web-application .`  # Execute Run built web-application container in detached mode with *api* name and *Port 80* accessible to *localhost*: `docker run -d -p 80:80 --name api web-application`  # Test To test if Application runs, open [http://localhost](http://localhost) URL in a Web Browser.  # Stop and Remove Container `docker stop api && docker rm api` 
author | tomas-petrauskas | ||||||
---|---|---|---|---|---|---|---|
permlink | how-to-dockerize-sample-net-core-api-web-application | ||||||
category | docker | ||||||
json_metadata | {"links":["https://github.com/tomas-petrauskas/dockerize-netcore","https://hub.docker.com/_/microsoft-dotnet-core-sdk/","https://hub.docker.com/_/microsoft-dotnet-core-aspnet/","http://localhost","http://localhost"],"image":["https://img.esteem.app/nncggk.png","https://img.esteem.app/24q684.png","https://img.esteem.app/6wx1dy.png","https://img.esteem.app/x7ltsw.png","https://img.esteem.app/5v73bk.png","https://img.esteem.app/oduv34.png"],"tags":["docker","c#",".net","api","web","dockerfile"],"app":"esteem/2.2.3-surfer","format":"markdown+html","community":"esteem.app"} | ||||||
created | 2020-02-28 06:59:21 | ||||||
last_update | 2020-02-28 07:02:51 | ||||||
depth | 0 | ||||||
children | 1 | ||||||
last_payout | 2020-03-06 06:59:21 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 1.021 HBD | ||||||
curator_payout_value | 1.051 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 1,605 | ||||||
author_reputation | 639,921,382,021 | ||||||
root_title | "How to Dockerize Sample .NET Core API/Web Application" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 95,900,831 | ||||||
net_rshares | 8,744,001,076,280 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
good-karma | 0 | 954,914,445,238 | 100% | ||
esteemapp | 0 | 7,765,658,689,210 | 50.8% | ||
adialam | 0 | 1,621,787,186 | 50% | ||
saintopic | 0 | 750,533,488 | 50% | ||
machroezar | 0 | 2,497,050,669 | 50% | ||
mini-zephalexia | 0 | 6,245,717,387 | 80% | ||
dodolzk | 0 | 955,957,398 | 50% | ||
zaibkang | 0 | 9,668,367,758 | 25% | ||
ekafao | 0 | 765,694,164 | 50% | ||
demo123 | 0 | 139,353,782 | 100% | ||
shyamali | 0 | 536,520,000 | 100% | ||
amala-gopal | 0 | 246,960,000 | 100% |
Congratulations @tomas-petrauskas! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) : <table><tr><td><img src="https://steemitimages.com/60x60/http://steemitboard.com/img/notifications/firstcommented.png"></td><td>You got a First Reply</td></tr> </table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@tomas-petrauskas) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=tomas-petrauskas)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
author | steemitboard |
---|---|
permlink | steemitboard-notify-tomas-petrauskas-20200228t070453000z |
category | docker |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2020-02-28 07:04:51 |
last_update | 2020-02-28 07:04:51 |
depth | 1 |
children | 0 |
last_payout | 2020-03-06 07:04:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 815 |
author_reputation | 38,975,615,169,260 |
root_title | "How to Dockerize Sample .NET Core API/Web Application" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 95,900,928 |
net_rshares | 0 |