﻿
{"id":14530,"date":"2020-03-25T18:15:41","date_gmt":"2020-03-25T18:15:41","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=14530"},"modified":"2020-03-25T19:35:56","modified_gmt":"2020-03-25T19:35:56","slug":"net-core-uygulamasini-dockerize-etmek-docker-image-nasil-olusturulur","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/net-core-uygulamasini-dockerize-etmek-docker-image-nasil-olusturulur\/","title":{"rendered":".NET Core Uygulamas\u0131n\u0131 Dockerize Etmek &#8211; Docker Image Nas\u0131l Olu\u015fturulur?"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>Bir \u00f6nceki <a href=\"https:\/\/www.gencayyildiz.com\/blog\/net-core-uygulamasini-dockerize-etmek-dockerfile-dosyasi-nasil-olusturulur\/\" target=\"_blank\" rel=\"noopener noreferrer\">Dockerfile Dosyas\u0131 Nas\u0131l Olu\u015fturulur?<\/a> ba\u015fl\u0131kl\u0131 makalemizde Dockerfile dosyas\u0131n\u0131n nas\u0131l olu\u015fturuldu\u011funu incelemi\u015f bulunmaktay\u0131z. Bu i\u00e7eri\u011fimizde ise Dockerfile dosyas\u0131nda belirtilen talimatlara uygun Docker Image&#8217;in nas\u0131l olu\u015fturulaca\u011f\u0131n\u0131 inceleyece\u011fiz.<\/p>\n<p>Docker Image olu\u015fturmadan \u00f6nce bilgisayar\u0131n\u0131zda;<\/p>\n<ul>\n<li>Docker&#8217;\u0131n \u00e7al\u0131\u015ft\u0131\u011f\u0131ndan,<\/li>\n<li>Docker&#8217;a giri\u015f yapt\u0131\u011f\u0131n\u0131zdan<\/li>\n<li>ve Linux containerda oldu\u011funuzdan<\/li>\n<\/ul>\n<p>emin olunuz.<\/p>\n<p>Yukar\u0131da adresi verilen \u00f6nceki makalemizde en son a\u015fa\u011f\u0131daki talimatlar\u0131 bar\u0131nd\u0131ran bir Dockerfile dosyas\u0131 olu\u015fturmu\u015ftuk;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nFROM mcr.microsoft.com\/dotnet\/core\/runtime:3.1\r\nWORKDIR \/app\r\nCOPY \/bin\/Release\/netcoreapp3.1\/publish \/app\r\nENTRYPOINT &#x5B;&quot;dotnet&quot;, &quot;DockerizeExample.dll&quot;]\r\n<\/pre>\n<p>\u015eimdi gelin bu talimatlara uygun image olu\u015ftural\u0131m.<\/p>\n<p><strong>Image Olu\u015fturma<\/strong><\/p>\n<p>Uygulama dizinini Komut \u0130stemci yahut Powershell ile a\u00e7arak a\u015fa\u011f\u0131daki Docker CLI komutu arac\u0131l\u0131\u011f\u0131yla uygulamaya bir image ekleyebilmekteyiz.<\/p>\n<p><strong style=\"font-size: 10px;\"><u>PROTOT\u0130P<\/u><\/strong><br \/>\n<em>docker build -t &lt;image_name&gt; &lt;dockerfile_path&gt;<\/em><\/p>\n<p>Yukar\u0131daki prototipe g\u00f6z atarsan\u0131z e\u011fer &#8216;-t&#8217; parametresinden sonra olu\u015fturulacak image&#8217;in ismi belirtilmelidir.<\/p>\n<p><strong style=\"font-size: 10px; color: red;\"><u>KOD<\/u><\/strong><br \/>\n<code style=\"color: red;\"><strong>docker build -t image1 .<\/strong><\/code><\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur.jpg\" alt=\".NET Core Uygulamas\u0131n\u0131 Dockerize Etmek - Docker Image Nas\u0131l Olu\u015fturulur?\" width=\"822\" height=\"313\" class=\"alignnone size-full wp-image-14573\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur.jpg 822w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-300x114.jpg 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-768x292.jpg 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><\/p>\n<p>G\u00f6rsele dikkat ederseniz e\u011fer her bir talimata kar\u015f\u0131l\u0131k bir katman olu\u015fturulmaktad\u0131r.<\/p>\n<p><strong>T\u00fcm Imagelerin Listelenmesi<\/strong><br \/>\nImageleri listeleyebilmek i\u00e7in a\u015fa\u011f\u0131daki kodu \u00e7al\u0131\u015ft\u0131rman\u0131z yeterlidir.<\/p>\n<p><strong style=\"font-size: 10px; color: red;\"><u>KOD<\/u><\/strong><br \/>\n<code style=\"color: red;\"><strong>docker images<\/strong><\/code><\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-1.jpg\" alt=\".NET Core Uygulamas\u0131n\u0131 Dockerize Etmek - Docker Image Nas\u0131l Olu\u015fturulur?\" width=\"843\" height=\"86\" class=\"alignnone size-full wp-image-14547\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-1.jpg 843w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-1-300x31.jpg 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-1-768x78.jpg 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/a><\/p>\n<p><strong>Image Silmek<\/strong><br \/>\nVar olan herhangi bir image&#8217;i silmek istiyorsan\u0131z e\u011fer a\u015fa\u011f\u0131daki kod konseptlerinden birini kullanabilirsiniz.<\/p>\n<p><strong style=\"font-size: 10px;\"><u>PROTOT\u0130P<\/u><\/strong><br \/>\n<em>docker rmi Image &lt;image_name&gt;<\/em>,<br \/>\n<em>docker rmi Image &lt;image_id&gt;<\/em>,<br \/>\n<em>docker rmi Image &lt;image_id_first_chars&gt;<\/em><\/p>\n<p><strong style=\"font-size: 10px; color: red;\"><u>KOD<\/u><\/strong><br \/>\n<code style=\"color: red;\"><strong>docker rmi Image image1<\/strong><\/code><br \/>\n<code style=\"color: red;\"><strong>docker rmi Image 0f88bbc2a78a<\/strong><\/code><br \/>\n<code style=\"color: red;\"><strong>docker rmi Image 0f8<\/strong><\/code>(\u0130lk birka\u00e7 benzersiz karakter)<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-2.jpg\" alt=\".NET Core Uygulamas\u0131n\u0131 Dockerize Etmek - Docker Image Nas\u0131l Olu\u015fturulur?\" width=\"845\" height=\"185\" class=\"alignnone size-full wp-image-14551\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-2.jpg 845w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-2-300x66.jpg 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2020\/03\/NET-Core-Uygulamas\u0131n\u0131-Dockerize-Etmek-Docker-Image-Nas\u0131l-Olu\u015fturulur-2-768x168.jpg 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/a><\/p>\n<p>Bir sonraki yaz\u0131m\u0131zda \u00fcretilen image \u00fczerinden nas\u0131l aya\u011fa container kald\u0131r\u0131labilece\u011fini inceleyece\u011fiz. O halde \u015fimdilik g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<\/p>\n<p>\u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, Bir \u00f6nceki Dockerfile Dosyas\u0131 Nas\u0131l Olu\u015fturulur? ba\u015fl\u0131kl\u0131 makalemizde Dockerfile dosyas\u0131n\u0131n nas\u0131l olu\u015fturuldu\u011funu incelemi\u015f bulunmaktay\u0131z. Bu i\u00e7eri\u011fimizde ise Dockerfile dosyas\u0131nda belirtilen talimatlara uygun Docker Image&#8217;in nas\u0131l olu\u015fturulaca\u011f\u0131n\u0131 inceleyece\u011fiz. Docker Image olu\u015fturmadan \u00f6nce bilgisayar\u0131n\u0131zda; Docker&#8217;\u0131n&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":14313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2739,3033,3101,3281],"tags":[3284,3292,3316,3315,3291,3300],"class_list":["post-14530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net-core","category-net-core-3-0","category-net-core-3-1","category-docker","tag-docker","tag-docker-image","tag-docker-image-nasil-olusturulur","tag-docker-image-olusturma","tag-dockerfile","tag-dockerize"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/14530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=14530"}],"version-history":[{"count":20,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/14530\/revisions"}],"predecessor-version":[{"id":14574,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/14530\/revisions\/14574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/14313"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=14530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=14530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=14530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}