Containers Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/cloud-computing/containers-cloud-computing/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Wed, 15 Jan 2020 21:59:02 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.2 https://www.anujvarma.com/wp-content/uploads/anujtech.png Containers Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/cloud-computing/containers-cloud-computing/ 32 32 Common Issues encountered while hosting your web app / website within a Container ( versus hosting it on the host server ) https://www.anujvarma.com/common-issues-encountered-while-hosting-your-web-app-website-within-a-container-versus-hosting-it-on-the-host-server/ https://www.anujvarma.com/common-issues-encountered-while-hosting-your-web-app-website-within-a-container-versus-hosting-it-on-the-host-server/#respond Wed, 15 Jan 2020 21:37:40 +0000 https://www.anujvarma.com/?p=6322 Issue 1 – Domain Joining Issue for Containers: A server can be domain joined. A container cannot. Solution to Issue 1 – Use an Active Directory gMSA. Create a gMSA […]

The post Common Issues encountered while hosting your web app / website within a Container ( versus hosting it on the host server ) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Issue 1 – Domain Joining Issue for Containers: A server can be domain joined. A container cannot.
Solution to Issue 1 – Use an Active Directory gMSA. Create a gMSA in AD – and run the container as an authorized service under this gMSA (like a service account). This essentially ‘joins’ the container to the Domain.

Issue 2 – Installing certificates for your website / webapp inside a container
Solution to Issue 2 – You need powershell on windows or bash on linux. For Windows, add the following to your DOCKERFILE

RUN mkdir C:\cert

#cert folder contains the certificates MyCertificate.cer & myprivatekey.pfx. Add these to the docker folder /cert
ADD cert/ /cert

RUN powershell -NoProfile -Command \
certutil -addstore "Root" "C:/cert/MyCertificate.cer"

RUN powershell -NoProfile -Command \
certutil -importpfx -p "password" "C:/cert/myprivatekey.pfx"

RUN powershell -NoProfile -Command \ 
New-WebBinding -Name "YourWebsite" -IP "*" -Port 1234 -Protocol https

RUN powershell -NoProfile -Command \
get-item cert:\LocalMachine\MY\thumbprint-of-your-cert | New-Item 0.0.0.0!1234

The post Common Issues encountered while hosting your web app / website within a Container ( versus hosting it on the host server ) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/common-issues-encountered-while-hosting-your-web-app-website-within-a-container-versus-hosting-it-on-the-host-server/feed/ 0
Quickstart for Docker on Windows https://www.anujvarma.com/quickstart-for-docker-on-windows/ https://www.anujvarma.com/quickstart-for-docker-on-windows/#respond Thu, 06 Dec 2018 14:27:53 +0000 http://www.anujvarma.com/?p=5505 Installation of Docker Runtime Step 1 – Launch a Powershell (as Administrator) window Step 2 - Invoke-WebRequest "https://master.dockerproject.org/windows/x86_64/docker.zip" -OutFile "$env:TEMP\docker.zip" -UseBasicParsing Step 3 - Expand-Archive -Path "$env:TEMP\docker.zip" -DestinationPath $env:ProgramFiles Step […]

The post Quickstart for Docker on Windows appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Installation of Docker Runtime

Step 1 – Launch a Powershell (as Administrator) window

Step 2 - Invoke-WebRequest "https://master.dockerproject.org/windows/x86_64/docker.zip" -OutFile "$env:TEMP\docker.zip" -UseBasicParsing

Step 3 - Expand-Archive -Path "$env:TEMP\docker.zip" -DestinationPath $env:ProgramFiles

Step 4 and 5 – Sets correct ENV variables and persists commands across reboots

# Add path to this PowerShell session immediately
$env:path += ";$env:ProgramFiles\Docker"

# For persistent use after a reboot
$Path = [Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("Path", $Path + ";$env:ProgramFiles\Docker", [EnvironmentVariableTarget]::Machine)

That’s it for the installation of the docker runtime

Creating your first Dockerized App (Package – Asp.net , IIS and a simple index.html app)

In a simple text file (called DockerFile, case doesn’t matter)  – add the following lines.  This file should sit in the root folder where your project (app code) sits.

FROM microsoft/iis

RUN mkdir c:\MyProjects\MyApp

RUN powershell -NoProfile -Command \

Install-WindowsFeature NET-Framework-45-ASPNET; \

Install-WindowsFeature Web-Asp-Net45; \

Import-Module IISAdministration; \

New-IISSite -Name "MyApp" -PhysicalPath C:\myapp -BindingInformation "*:8000:"

EXPOSE 8000

ADD bin/ /myapp

 

The EXPOSED port is not where the app will run – it is simply for YOU (the user) to interact with the running container.

The rest of the commands (FROM, RUN..are self explanatory)

The ADD command is where you can specify your custom app –  in a presumed bin folder.  So your folder structure should look like

Add files from local file system to your Docker container

Building the Container and Running the App

To build and run the container image,  in a powershell prompt (inside the root folder)

docker build .

Browse to http://127.0.0.1/index.html to see your Dockerized App running!

Summary

This was meant as a quick start for getting your hands dirty with Docker on Windows. There’s tons of options and variations here (such as optional parameters to pass in, ENTRYPOINT for your app etc.), but this will get you started.

The post Quickstart for Docker on Windows appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/quickstart-for-docker-on-windows/feed/ 0
Containers versus VMs, Docker Tools and Orchestration https://www.anujvarma.com/containers-versus-vms-docker-tools-and-orchestration/ https://www.anujvarma.com/containers-versus-vms-docker-tools-and-orchestration/#respond Fri, 09 Feb 2018 15:39:57 +0000 http://www.anujvarma.com/?p=5100 Key Aspects of Containers Just as VMs are hardware level (server level) virtualization, containers are OS level virtualization. VM – Primary Use Case – Multiple OSes can be supported on […]

The post Containers versus VMs, Docker Tools and Orchestration appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Key Aspects of Containers
  • Just as VMs are hardware level (server level) virtualization, containers are OS level virtualization.
  • VM – Primary Use Case – Multiple OSes can be supported on a single hypervisor (Virtualization Platform on hardware)
  • Container  – Primary Use Case – Multiple Apps to be supported on a single platform (Docker Engine)

Containers enable quick, agile development, since they are:

  1. Transitory
  2. Disposable
  3. Can live alongside persistent storage
  4. Can complement existing virtualization

Docker Orchestration

Additional tooling to coordinate containers across multiple machines is known as container orchestration.

  1. Marathon on Apache Mesos – first to support Docker orchestration (the gold standard for production clusters).
  2. Kubernetes 
  3. Docker Swarm (now part of Docker Engine)
  4. Nomad

Docker Tools

  • Docker hub for public storage of Docker images
  • Docker registry on-premise storage of Docker Images
  • Docker cloud  – a managed service for building and running containers
  • Docker datacenter –  a commercial offering embodying many Docker technologies

Docker Competitors

  • Kubernetes and Kubernetes Engine
  • Apache Mesos and Mesosphere
  • Cloud Foundry
  • Azure Container Services
  • Open Container Initiative (OCI)
  • CoreOS and rkt
  • Canonical and LXD

The post Containers versus VMs, Docker Tools and Orchestration appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/containers-versus-vms-docker-tools-and-orchestration/feed/ 0