Multiarch Docker Images - JUG Saxony · Demo: Enjoy on Linux (amd64 or Raspberry Pi) Demo: Enjoy on...

Post on 26-May-2018

247 views 0 download

Transcript of Multiarch Docker Images - JUG Saxony · Demo: Enjoy on Linux (amd64 or Raspberry Pi) Demo: Enjoy on...

B U I L D A N D D E P L O Y M U LT I A R C H L I N U X A N D W I N D O W S C O N TA I N E R I M A G E SS T E FA N S C H E R E R @ s t e f s c h e r e r

♥ ♥

DockerjourneytoMultiArch+MultiOS

Createamulti-archDockerimage

BuildaCIpipeline

Tips&Tricks

Agenda

whoami

StefanSchererSr.SoDwareEngineerSEALSystems

Blogatstefanscherer.github.io@stefscherer

Whatisacontainer?

Whatisacontainer?

StandardizedpackagingforsoDwareanddependencies

Isolateappsfromeachother

SharethesameOSkernel

WorksforallmajorLinuxdistribuMons

Containersonallmajorplatforms

dockercontainerrun

Hub

nginx microsoft/iis

dockercontainerrun-differentOS

Hub

nginx microsoft/iis

⚡ ⚡LCOWFTW!

dockercontainerrun-differentCPUarchitecture

Hub

nginx

⚡ ⚡

IBMs390

arm32v7/nginx

Manifestlists

Manifestlist

Hub

me/myapp

Manifestlist:dockercontainerrun

Hub

me/myapp me/myappme/myapp

Usecases

dockerrunportainer/portainer

dockerrunmicrosoft/dotnet

Manyofficialimagesaremulti-archnow

Windowsworkinprogress…

Howtobuildcontainerimages?

dockerimagebuild/dockerimagepush

Hub

me/myapp:linux me/myapp:windows

Howtobuildthemanifestlist?

dockermanifestcommand

Pullrequesthttps://github.com/docker/cli/pull/138Docker17.12?

manifest-toolfromPhilEstes

Binariesathttps://github.com/estesp/manifest-tool/releases

Availability

dockermanifestcreate

Hub

me/myapp

dockermanifestpush

Hub

me/myapp

Demo buildingamulti-archcontainerimage

Demo:BuildLinuxamd64+crossforarm(Raspberry)

Demo:BuildWindows2016+1709(withtwoVM’s)

Demo:Createmanifestlist

Demo:Fixcrossbuildarch+variant

Demo:Pushmanifestlist

Demo:EnjoyonLinux(amd64orRaspberryPi)

Demo:EnjoyonWindows10,2016or1709

Demo:ImagesandManifestlistonDockerHub

HowtobuildaCIpipelineforthat?

DockerCIPipelineforLinuxandWindowsdockerimagepush

gitpush

dockerimagepush

ContainerRegistry

RunUnitTestsBuildAppdockerimagebuild

dockermanifestpush

Hub

DockerCIPipelineforLinuxandWindowsdockerimagepush

gitpush

dockerimagepush

RunUnitTestsBuildAppdockerimagebuild

dockermanifestpush

Example:github.com/StefanScherer/whoami

Tips&Tricks

ShowtheplatformsofaDockerHubimage

ShowtheplatformsofaDockerHubimage

ShowtheplatformsofaDockerHubimage

ShowtheplatformsofaDockerHubimage

WindowsServer2016

WindowsServer1709

Usenodeconstraintsinahybridclusterservices:web:image:microsoft/iis

deploy:placement:constraints:

-node.platform.os==windows

Usenodeconstraintsinahybridclusterservices:web:image:nginx

deploy:placement:constraints:

-node.platform.os==linux

Usenodeconstraintsinahybridcluster"spec":{"containers":[{"name":"iis","image":"microsoft/iis",...}],"nodeSelector":{"beta.kubernetes.io/os":"windows"}}

dockermanifestcommand

Pullrequesthttps://github.com/docker/cli/pull/138Docker17.12?

manifest-toolfromPhilEstes

Binariesathttps://github.com/estesp/manifest-tool/releases

Availability

dockerimagebuilddockerimagepush

dockerimagebuilddockerimagepush

dockermanifestcreatedockermanifestpush

Recap

me/myapp

me/myapp:linux

me/myapp:windows

T H A N K Y O U ! Q U E S T I O N S ?

S T E FA N S C H E R E R @ s t e f s c h e r e r