Docker
Docker is a very popular in the world of containers as a standard repository and management layer of containers both in Linux and Windows
Setting up Docker
On Windows 10
prereqs - HyperV - Containers Docker on Windows 10 install
Windows 2016
Docker can be installed as an app or as a service. Running it as a service and interacting via powershell and the command line is the preferred production instalaltion
Configuration
The Docker configuration file is how you setup Docker in a Windows environment. Location: C:\ProgramData\Docker\Config\Daemon.json
Images
Images are container templates. OS and app. they can be used to build the running container. They are layered upon each other. It is a single, self contained, file that represents your application.
Docker Images
to list images in your private repo.
Docker images and containers end up being stored in the Local Docker Registry. To save the container or image to the local hard drive so it can be shared with others use Docker save with Images and Docker Export with a paused or stopped Container. This doc goes into better detail.
Images are built ontop of a base image. This base image can either be a black OS image or an image that already has required applications installed (layered). These images can either be created in-house or downloaded from and online repository such as Docker Hub or the new Docker Store.
Images can be downloaded with the follwoing
Docker Pull <name>
Building Images
Dockerfile
File that contains the commansds used to build an image. These are the same commands that you would use from the command line.
Container
A container is a running instance of an image.
Docker Registry
Location where your containers are stored for sharing. Usually Docker Hub but can be installed on your local system or a server
DockerHub
Location images can be stored online.
Autobuild
Dockerhub can be linked to Github or Bitbucket and triger image builds when the linked repo is updated. I am currently having problems doing this with a windows container so autobuild may not work with windows containers.
Neverfear. Found a way to do it with Team City. https://lostechies.com/gabrielschenker/2016/03/22/ci-with-teamcity-and-docker/
Networking
Installing docker on windows creates several new networks. According to Docker Container Networking, it creates three. On my Windows 10 environment, I have all three but the Bridged network is named Default Switch.
nat
bridge (Default Switch) - This is the default network a container will connect. The also gets connected to this network. It essentially is the local private network between the host and its containers.
None - The container will not be connected to any network.
Since Docker runs on top of Hyper-V, if you have any Hyper-V virtual switches, those will show up as well.
You can use the docker network ls
to show the networks configured on your machine.
To attach to a network, in my case I usually attache to my Hyper-V external network so the container is accessable from external sources, use the docker run --network <Network>
Docker Swarm
collection of Docker hosts that have been joined together in a cluster.
TO Research : Patching
To Research : Updating app / Service
Creating Docker Containers
Walkthrus for creating various types of containers
Node JS
JavaScript Runtime https://nodejs.org/en/
- Download the latest msi from the above link
DockerFile
FROM microsoft/windowsservercore
COPY node-v6.11.4-x64.msi c:/temp
# RUN msiexec.exe /q /i c:\temp\node-v6.11.4-x64.msi
run the container.
SQL 2014 Container
</a href = https://flynnbundy.com/2016/02/20/installing-sql-server-2016-in-a-windows-container/>
- Install SQL Host needs .Net 3.5 Export Regitry setting sor 3.5 Store in container image build location Copy SQL files to image build location Create SQL Configuration.ini Store in image build location Create DockerFile Store in image build location Build image Docker -t Build MSSQL2014dev c:\mssql c:\mssql is the image build location Create Container Docker run -it -v c:\datavolumes\jb-sql04\data:c:\data -v c:\datavolumes\jb-sql04\temp:c:\temp -v c:\datavolumes\jb-sql04\Logs:c:\Logs -v c:\datavolumes\jb-sql04\SQLBackup:c:\SQLBackup --name mssqlcontainer -p 1433:1433 mssql2014dev powershell
- ./Setup.exe
- Setup.exe /ConfigurationFile=configurationfile.ini /IACCEPTSQLSERVERLICENSETERMS /IACCEPTROPENLICENSETERMS /SQLSVCPASSWORD="*****" /AGTSVCPASSWORD="*****" /SAPWD="Password1" /FTSVCPASSWORD="*****"