Docker Windows + Continuous Delivery = <3
Laurent Grangeau
Guillaume Bizet
@laurentgrangeau@finaxys
Cedric Coroir
@guillaumebizet1@finaxys
@cedric_coroir@sg_insideit
Docker Windows + Continuous Delivery =
<3
Windows Server & Hyper-V containers
N° 4
LOB app(+Binaries)
Host OSw/Container Support
Server(Physical or Virtual)
Web tier
Container A
Libraries(Shared across containers)
Container B Container C
LOB app(+Binaries)
App tier
Libraries
LOB app(+Binaries)
DB tier
Hypervisor
Server
Hyper-V Container
App ABins/Libraries
Windows Guest OSOptimized for Hyper-V Container
Hyper-V Container
App BBins/Libraries
Windows Guest OSOptimized for Hyper-V Container
Docker integration
N° 5
Docker Client
Windows Server Linux
Docker Engine(Daemon)
Windows ServerContainer Support
Linux ContainerSupport
Docker Engine(Daemon)
Docker.exeExamples:docker rundocker images
Docker Remote APIExamples:GET images/jsonPOST containers/create
Continuous deliveryWhat is continuous delivery ?
N° 6
• Have a replicable environment• Build once, run everywhere• No more « it runs locally »
Continuous deliveryWhy Docker ?
N° 7
The new Continuous Delivery chainSociété Générale
N° 8
APP
IN P
AAS Dockerfile
Source Control Managerco
mpo
se GitHook
DeployContinuous Integration
Topology CaaSCD Platform Outside
ExternalxPaaS
Ambassadors
Applications& xPaaS
ITaaS
Source SG at dockercon 2016: https://www.youtube.com/watch?v=fd9yiUS6Sbw
Maturity and savings levels
N° 9
CONTAINED
AUTOMATED
EMPOWERED
MANAGED
Containerize App.
Automate in continuous delivery platform
Deploy on central Docker Execution Platform
Transform to leverage on built-in features:-Discovery-Elasticity-High availability Transform to in-
house standards:- Monitoring- Logging- Billing
Transform to fit with deployment topologies
Use managed services (xPaaS):DB, Cache, MQ...
MICRO SERVICES
Leverage on platform securitystandards
Dynamic scale, hybrid cloud usecase
PlatformContinuous delivery platform
N° 10
Github
Build the app in a
container
Grab log of ran
container
Store artifacts on TC master
Generate app image
Deploy on Docker
Servicehook
Build the appStore artifactsGenerate app image
Run theapp image
Simple picture of the builder+imageContinuous delivery platform
N° 11
Builder image
Docker file
App Docker Image
PlatformBuilder image
N° 12
builder.bat
choco: nuget/msbuild/web-target
powershell: asp-net45
git
chocolatey
windowsservercore
echo "##enter container of build ##"git clone %repogit%echo "Clone done"set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319cd c:\cd %slnpath%nuget restoremsbuildcd /robocopy C:\%slnpath% c:\work\output /Epowershell -Command "(Get-Content c:\build.txt) -replace 'mybuild', $Env:mybuild | Set-Content c:\build.xml"curl.exe -v -u gbizet:XXXXXXX http://178.33.83.137/app/rest/buildQueue --request POST --header "Content-Type:application/xml" --data-binary @build.xml
PlatformBuilder dockerfile
N° 13
FROM guibizet/gitENV repogit repogitENV slnpath testsENV mybuild nameofcontainerRUN ["choco","install","nuget.commandline","-y"]RUN ["choco","install","microsoft-build-tools","-y"]RUN ["choco","install","curl","-y"]RUN mkdir workVOLUME c:\\workCOPY ./builder.bat .COPY ./build.txt .CMD builder.bat
Builder.bat
PlatformDockerfile
N° 14
FROM windowsservercoreRUN dism /online /enable-feature /all /featurename:iis-webserver /NoRestart#RUN dism /online /enable-feature /all /featurename:IIS-ASPNET45 /NoRestart RUN powershell -executionpolicy bypass -command "add-windowsfeature Web-Asp-Net45"RUN cd c:\\inetpub\\wwwrootRUN mkdir demoRUN cd demoRUN mkdir websiteCOPY ./FinaxysMeetup/ c:\\inetpub\\wwwroot\\demo\\websiteRUN /windows/system32/inetsrv/appcmd.exe set vdir "Default Web Site/" -physicalPath:"c:\inetpub\wwwroot\demo\website"
CMD ["cmd"]
echo "Launching Build container"docker run -d --name %nameofbuild% -e "mybuild=%nameofbuild%" -e "repogit=%giturltobuild%" -e "slnpath=%slnpath%" -v %teamcity.build.checkoutDir%:c:\work guibizet/builder-dotnet:%versionbuilder%
Build configuration using binary from Build Container and building docker image of the appdocker build -t guibizet/%dep.DockerWindows_LogsOfTheContainer.env.nameofbuild%:1.%build.counter% .docker rm -fv %dep.DockerWindows_LogsOfTheContainer.env.nameofbuild%docker run -d --name %dep.DockerWindows_LogsOfTheContainer.env.nameofbuild% -p 80:80 guibizet/%dep.DockerWindows_LogsOfTheContainer.env.nameofbuild%:1.%build.counter% powershelldocker push guibizet/%dep.DockerWindows_LogsOfTheContainer.env.nameofbuild%:1.%build.counter%
Quick overview of TC build config
N° 15
• Create your own builder image
• Build your application inside the builder image
• Leverage on every aspect of Docker in the Continuous delivery chain
Takeaway
N° 16
N° 17
@microsoftfrance @Technet_France @msdev_fr@laurentgrangeau | @guillaumebizet1 |
@finaxys
N° 18
Notez cette sessionEt tentez de gagner un Surface Book
Doublez votre chance en répondant aussi au questionnaire de satisfaction globale* Le règlement est disponible sur demande au commissariat général de l’exposition. Image non-
contractuelle
Top Related