{"id":701,"date":"2022-01-11T16:07:45","date_gmt":"2022-01-11T15:07:45","guid":{"rendered":"https:\/\/reglisss.freeboxos.fr\/wordpress\/?page_id=701"},"modified":"2022-01-11T16:07:45","modified_gmt":"2022-01-11T15:07:45","slug":"vive-la-dockerisation","status":"publish","type":"page","link":"https:\/\/reglisss.freeboxos.fr\/wordpress\/vive-la-dockerisation\/","title":{"rendered":"VIVE LA DOCKERISATION"},"content":{"rendered":"\n<p>INSTALLATION DE DOCKER POUR WINDOWS<\/p>\n\n\n\n<p><a href=\"https:\/\/www.docker.com\/get-started\">https:\/\/www.docker.com\/get-started<\/a><\/p>\n\n\n\n<p>choisir windows puis next next next <\/p>\n\n\n\n<p>une fois get-started faire les lacement requis puis next etc &#8230;<\/p>\n\n\n\n<p>INSTALLATION DE WINDOWS NANO SERVER IIS 2016<\/p>\n\n\n\n<p>aller dans<\/p>\n\n\n\n<p> https:\/\/hub.docker.com\/<\/p>\n\n\n\n<p>puis chercher \u00ab\u00a0nanoserver\u00a0\u00bb<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1024x576.png\" alt=\"\" class=\"wp-image-702\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>puis copier le script docker<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1-1024x576.png\" alt=\"\" class=\"wp-image-703\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-1.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>et le coller dans une commande POWERSHELL en ADMIN !<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2-1024x576.png\" alt=\"\" class=\"wp-image-704\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-2.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>SI CA NE MARCHE PAS  ( image operating system \u00ab\u00a0windows\u00a0\u00bb cannot be used on this platform) C&rsquo;EST NORMAL \ud83d\ude09<\/p>\n\n\n\n<p>il faut selectionner switch to windows containers dans le bouton droit sur l&rsquo;icone de docker de la barre des taches.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3-1024x576.png\" alt=\"\" class=\"wp-image-705\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-3.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>une fois tout installer aller dans docker puis container \/apps<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4-1024x576.png\" alt=\"\" class=\"wp-image-706\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-4.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>lancer avec le bouton play sur le container puis CLI <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5-1024x576.png\" alt=\"\" class=\"wp-image-707\" srcset=\"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5-1024x576.png 1024w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5-300x169.png 300w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5-768x432.png 768w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5-1536x864.png 1536w, https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-content\/uploads\/2022\/01\/image-5.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>puis dans la fenetre docker <\/p>\n\n\n\n<p>Install-Module -Name IISAdministration ou Install-Module -Force -name IISAdministration<\/p>\n\n\n\n<p>puis<\/p>\n\n\n\n<p>Import-Module IISAdministration -UseWindowsPowerShell<\/p>\n\n\n\n<p><strong>Cr\u00e9ation de sites web<\/strong><\/p>\n\n\n\n<p>Utilisez cette applet de commande&nbsp;:<\/p>\n\n\n\n<p><code>PS D:\\&gt; New-IISSite -Name TestSite -BindingInformation *:80:TestSite -PhysicalPath c:\\test<\/code><\/p>\n\n\n\n<p>Vous pouvez ensuite ex\u00e9cuter&nbsp;<code>Get-IISSite<\/code>&nbsp;pour v\u00e9rifier l\u2019\u00e9tat du site (renvoie le nom, l\u2019ID, l\u2019\u00e9tat, le chemin d\u2019acc\u00e8s physique et les liaisons du site web).<\/p>\n\n\n\n<p><strong>Suppression de sites web<\/strong><\/p>\n\n\n\n<p>Ex\u00e9cutez&nbsp;<code>Remove-IISSite -Name TestSite -Confirm:$false<\/code>.<\/p>\n\n\n\n<p><strong>Cr\u00e9ation de r\u00e9pertoires virtuels<\/strong><\/p>\n\n\n\n<p>Vous pouvez cr\u00e9er des r\u00e9pertoires virtuels \u00e0 l\u2019aide de l\u2019objet IISServerManager renvoy\u00e9 par Get-IISServerManager, qui affiche l\u2019API Microsoft.Web.Administration.ServerManager.NET. Dans cet exemple, les commandes suivantes acc\u00e8dent \u00e0 l\u2019\u00e9l\u00e9ment Site web par d\u00e9faut de la collection Sites et \u00e0 l\u2019\u00e9l\u00e9ment d\u2019application racine (\/) de la section Applications. Ensuite, elles appellent la m\u00e9thode Add() de la collection VirtualDirectories pour cet \u00e9l\u00e9ment d\u2019application afin de cr\u00e9er le r\u00e9pertoire&nbsp;:PowerShellCopier<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\&gt; $sm = Get-IISServerManager\nPS C:\\&gt; $sm.Sites&#91;\"Default Web Site\"].Applications&#91;\/].VirtualDirectories.Add(\/DemoVirtualDir1, c:\\test\\virtualDirectory1)\nPS C:\\&gt; $sm.Sites&#91;\"Default Web Site\"].Applications&#91;\/].VirtualDirectories.Add(\/DemoVirtualDir2, c:\\test\\virtualDirectory2)\nPS C:\\&gt; $sm.CommitChanges()\n<\/code><\/pre>\n\n\n\n<p><strong>Cr\u00e9ation de pools d&rsquo;applications<\/strong><\/p>\n\n\n\n<p>De m\u00eame, vous pouvez utiliser Get-IISServerManager pour cr\u00e9er des pools d\u2019applications&nbsp;:PowerShellCopier<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\&gt; $sm = Get-IISServerManager\nPS C:\\&gt; $sm.ApplicationPools.Add(DemoAppPool)\n<\/code><\/pre>\n\n\n\n<p><strong>Configuration du protocole HTTPS et de certificats<\/strong><\/p>\n\n\n\n<p>Utilisez l\u2019utilitaire Certoc.exe pour importer des certificats, comme dans cet exemple qui pr\u00e9sente la configuration HTTPS d\u2019un site Web sur un Nano Server&nbsp;:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Sur un autre ordinateur qui n\u2019ex\u00e9cute pas Nano Server, cr\u00e9ez un certificat (\u00e0 l\u2019aide de votre propre nom et mot de passe de certificat), puis exportez-le vers c:\\temp\\test.pfx.<code>$newCert = New-SelfSignedCertificate -DnsName www.foo.bar.com -CertStoreLocation cert:\\LocalMachine\\my<\/code><code>$mypwd = ConvertTo-SecureString -String YOUR_PFX_PASSWD -Force -AsPlainText<\/code><code>Export-PfxCertificate -FilePath c:\\temp\\test.pfx -Cert $newCert -Password $mypwd<\/code><\/li><li>Copiez le fichier test.pfx sur l\u2019ordinateur de Nano Server.<\/li><li>Sur le Nano Server, importez le certificat dans le magasin My avec cette commande&nbsp;:<strong>certoc.exe -ImportPFX -p YOUR_PFX_PASSWD My c:\\temp\\test.pfx<\/strong><\/li><li>R\u00e9cup\u00e9rez l\u2019empreinte num\u00e9rique de ce nouveau certificat (dans cet exemple, 61E71251294B2A7BB8259C2AC5CF7BA622777E73) avec&nbsp;<code>Get-ChildItem Cert:\\LocalMachine\\my<\/code>.<\/li><li>Ajoutez la liaison HTTPS vers le site web par d\u00e9faut (ou au site dont vous souhaitez ajouter la liaison) \u00e0 l\u2019aide de ces commandes Windows PowerShell&nbsp;:PowerShellCopier<code>$certificate = get-item Cert:\\LocalMachine\\my\\61E71251294B2A7BB8259C2AC5CF7BA622777E73 # Use your actual thumbprint instead of this example $hash = $certificate.GetCertHash() Import-Module IISAdministration $sm = Get-IISServerManager $sm.Sites[\"Default Web Site\"].Bindings.Add(\"*:443:\", $hash, \"My\", \"0\") # My is the certificate store name $sm.CommitChanges() <\/code>Vous pouvez \u00e9galement utiliser l&rsquo;Indication de nom de serveur (SNI) avec un nom d&rsquo;h\u00f4te sp\u00e9cifique selon cette syntaxe&nbsp;:&nbsp;<code>$sm.Sites[\"Default Web Site\"].Bindings.Add(\"*:443:www.foo.bar.com\", $hash, \"My\", \"SNI\")<\/code><\/li><\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>INSTALLATION DE DOCKER POUR WINDOWS https:\/\/www.docker.com\/get-started choisir windows puis next next next une fois get-started faire les lacement requis puis next etc &#8230; INSTALLATION DE WINDOWS NANO SERVER IIS 2016 aller dans https:\/\/hub.docker.com\/ puis chercher \u00ab\u00a0nanoserver\u00a0\u00bb puis copier le script docker et le coller dans une commande POWERSHELL en ADMIN ! SI CA NE MARCHE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-701","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/pages\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/comments?post=701"}],"version-history":[{"count":1,"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/pages\/701\/revisions"}],"predecessor-version":[{"id":708,"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/pages\/701\/revisions\/708"}],"wp:attachment":[{"href":"https:\/\/reglisss.freeboxos.fr\/wordpress\/wp-json\/wp\/v2\/media?parent=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}