{"id":20605223,"url":"https://github.com/arnab-developer/basicdockercommands","last_synced_at":"2026-01-30T20:02:17.436Z","repository":{"id":68914990,"uuid":"423765070","full_name":"Arnab-Developer/BasicDockerCommands","owner":"Arnab-Developer","description":"Basic docker commands","archived":false,"fork":false,"pushed_at":"2021-11-02T09:48:54.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T05:03:40.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arnab-Developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T08:37:37.000Z","updated_at":"2021-12-05T05:48:16.000Z","dependencies_parsed_at":"2023-03-24T11:20:31.580Z","dependency_job_id":null,"html_url":"https://github.com/Arnab-Developer/BasicDockerCommands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Arnab-Developer/BasicDockerCommands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FBasicDockerCommands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FBasicDockerCommands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FBasicDockerCommands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FBasicDockerCommands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arnab-Developer","download_url":"https://codeload.github.com/Arnab-Developer/BasicDockerCommands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FBasicDockerCommands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:27:11.599Z","updated_at":"2026-01-30T20:02:17.420Z","avatar_url":"https://github.com/Arnab-Developer.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic docker commands\nThis is a document for basic docker commands. You need .NET 5 SDK and docker desktop installed in\nyour machine to follow the below steps.\n\n## Create a .NET web api\nOpen terminal and execute the below commands to create a new .NET web api.\n\n```\ncd c:\\\n\nmkdir Api1\n\ncd Api1\n\ndotnet new webapi\n\ndotnet run\n```\n\nOpen a web browser and test the api with `http://localhost:5000/weatherforecast`. \n\nNext publish the api in a separate folder.\n\n```\ncd c:\\\n\nmkdir Api1Publish\n\ncd Api1Publish\n\nmkdir publish\n\ncd..\n\ncd Api1\n\ndotnet publish -c Release -o ../Api1Publish/publish\n\ncd..\n\ncd Api1Publish\\publish\n\ndotnet Api1.dll\n```\n\nOpen a web browser and test the api with `http://localhost:5000/weatherforecast`. \n\n## Create docker container\nCreate a `Dockerfile` inside `Api1Publish` folder (not inside the `publish` folder). \n\n![image](https://user-images.githubusercontent.com/3396447/139822333-aed832fd-aa01-48f8-9295-f864e102dc1b.png)\n\nWrite the below code inside that.\n\n```\nFROM mcr.microsoft.com/dotnet/aspnet:5.0\nCOPY publish/ ./app\nWORKDIR /app\nENTRYPOINT [\"dotnet\", \"Api1.dll\"]\n```\n\nCreate docker image.\n\n```\ncd c:\\\n\ncd Api1Publish\n\ndocker build -t api1:1.0.0 .\n```\n\nCreate container from that image.\n\n```\ndocker create --name c1 -p 80:80 api1:1.0.0\n\ndocker start c1\n```\n\nOpen a web browser and test the api with `http://localhost:80/weatherforecast`.\n\n## Clean up\n```\ndocker rm c1\n\ndocker rmi api1:1.0.0\n```\n\nDelete the `Api1` and `Api1Publish` folders.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Fbasicdockercommands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnab-developer%2Fbasicdockercommands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Fbasicdockercommands/lists"}