SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
Docker:
an insider view
Google Developers Group Meetup
November 2013, Google West Campus 2
Michael Crosby — @crosbymichael
Jérôme Petazzoni — @jpetazzo
Victor Vieux — @vieux
Outline
●
●
●
●
●
●

what is Docker
why it is written in Go
some implementation details
drawbacks
more drawbacks
discussion
What’s Docker?
Docker solves the “Matrix from Hell”
Docker solves the “Matrix from Hell”
Docker solves the “Matrix from Hell”
static website

?

?

?

?

?

?

web frontend

?

?

?

?

?

?

background
workers

?

?

?

?

?

?

user DB

?

?

?

?

?

?

analytics DB

?

?

?

?

?

?

queue

?

?

?

?

?

?

dev VM

QA server

single
prod
server

on-site
cluster

public
cloud

contributor laptop
Real-world analogy: containers
Worldwide shipping:
another Matrix from Hell
clothes

?

?

?

?

wine

?

?

?

?

coffee

?

?

?

?

electronics

?

?

?

?

cars

?

?

?

?

raw materials

?

?

?

?

ships

trains

trucks

storage
Solution:
the intermodal shipping container
clothes
wine
coffee
electronics
cars
raw materials
ships

trains

trucks

storage
Solution to the deployment problem:
the Linux container
What’s a Linux container?
High level approach
Chroot on steroids
● normal processes, but isolated
● share kernel with the host
● no device emulation (neither PV nor HVM)
● doesn’t need a /sbin/init
(runs the app/DB/whatever directly)
“Application Container”
What’s a Linux container?
Low level approach
Lightweight Virtual Machine
● own process space
● own network interface
● can run stuff as root
● can have its own /sbin/init
(different from the host)
“Machine Container”
Separation of concerns:
Dave, from the dev team
●
●
●
●
●
●
●

my code
my framework
my libraries
my system dependencies
my packaging system
my distro
my data
I don’t care where it’s running or how.
Separation of concerns:
Oscar, from the ops team
●
●
●
●
●

logs
backups
remote access
monitoring
uptime
I don’t care what’s running in it.
OK, so what’s Docker?
Runtime for Linux containers
jpetazzo@tarrasque:~$ sudo docker run -t -i ubuntu bash
root@092ee318746f:/#
jpetazzo@tarrasque:~$ sudo docker run -d johncosta/redis
c6000fa5ddc6
jpetazzo@tarrasque:~$ sudo docker inspect c6000fa5ddc6
...
"NetworkSettings": {
"IPAddress": "172.17.0.8",
"Ports": {
"6379/tcp": null
}
...
Standard format for containers,
and a place to share them
● fetch an image from the registry with
“docker pull”
● enter the image with “docker run”,
do some changes
● record those changes with “docker commit”,
repeat as many time as needed
● then share the result with “docker push”,
on the public registry or on a private one
Why Go?
The Five Reasons Why We Used Go
Why Go?
1) static compilation
● “go build” will embed everything you need
(no more “install this in order to run my stuff”)
● … except dynamic libraries if you use cgo
(cgo lets you use any C library)
● and … except libc
(but who doesn’t have libc?)
● you can have a real static binary
(if you hack the build process a bit…)
Why Go?
1) static compilation
● easier to install, easier to test, easier to adopt
● good candidate for bootstrap
(i.e. the first installed thing,
which will install the other things)
● “no dependencies? me gusta!”
-- Anonymous BOFH
Why Go?
2) neutral
●
●
●
●

it’s not C++
it’s not Python
it’s not Ruby
it’s not Java
Why Go?
3) it has what we need
● good asynchronous primitives
(wait for I/O, wait for processes…)
● low-level interfaces
(manage processes, syscalls…)
● extensive standard library and data types
● strong duck typing
Why Go?
4) full development environment
Go addresses multiple issues of the development
workflow.
●
●
●
●
●

go doc (see documentation for any package)
go get (fetch dependencies on github etc.)
go fmt (solve “tabs vs. spaces” once for all)
go test (runs all Test* functions in *_test.go)
go run (rapid script-like prototyping)
Why Go?
5) multi-arch build
...without pre-processors
_linux.go
_darwin.go
Drawbacks
Because that’s the
most interesting thing
in Amazon reviews
“Go doesn’t solve any problem”
Jonn Mostovoy @podmostom29 Sep
@benoitc @arnaudsj in not solving any problems.
Everything they claim to solve is better solved in Dv2.
0, Erlang or will be solved in Rust..

But...
● Go is easier than Erlang
● Go is more real than Rust
● Don’t know about D 2.0 though!
maps aren’t thread-safe
● deliberate decision: they’re fast
(and it’s up to you to ensure that they’re safe)
● you have to protect access with sync.Mutex
● or, use channels of channels!
m := NewMap()
response := make(chan string)
m<-Get{Key: “fortytwo”, Replyto: response}
value := <-response
go get
● can’t pin a particular revision
● Docker had to vendor all dependencies
(i.e. import their source code in our repo)
● must deal with private repos manually
go test
● can’t have destructors/cleanups/… in tests
● use a test named “z_final_test.go”
● … which doesn’t work too well when running
individual tests!
go build
● it’s painful to build multiple binaries,
when they share some common code
● each program has to be in its own package,
and package must be “main”
● you have to put shared/common stuff aside,
or use named import tricks (bleh)
flag package
● doesn’t handle short/long options
(-o --option)
● doesn’t handle options grouping
(-abc -a -b -c)
● seriously just don’t use it
(use getopt or go-flags instead)
unless your primary target is Plan9 of course!
no IDE

Let’s ask Samuel Jackson
what he thinks about it
Error handling can be verbose
if err := openFile(); err != nil {
return err
}
if err := readAll(); err != nil {
return err
}
if err := closeFile(); err != nil {
return err
}
...
Error handling
● panic / recover
(don’t abuse it; only use it internally!)
● deploy one-off utility types
http://talks.golang.org/2013/bestpractices.slide#5
can’t select on readers/writers
select {
case data = <-inputChannel:
…
case data = <-otherInputChannel:
…
case data = connection.Read():
…
}
can’t select on readers/writers
● for readers:
○ start a goroutine with access to an output channel
○ the goroutine do blocking reads on the readers…
○ …and pushes the results on the output channel

● for writers:
○ adaptation is left as an exercise for the reader

→ reduce everything to channels!
Some useful resources:
● The Holy Reference:
http://golang.org/ref/spec
● Some useful patterns:
http://golang.org/doc/effective_go.html
● Some best practices:
http://talks.golang.org/2013/bestpractices.slide
● Embedded documentation:
godoc -http=:6060 & chrome http://localhost:6060

Michael Crosby — @crosbymichael
Jérôme Petazzoni — @jpetazzo
Victor Vieux — @vieux
Thank you!
Questions?
Michael Crosby — @crosbymichael
Jérôme Petazzoni — @jpetazzo
Victor Vieux — @vieux

Contenu connexe

Tendances

Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistenceJanakiram MSV
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking JenkinsMiro Cupak
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation dockerOlivier Eeckhoutte
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backendSebastian Poxhofer
 
Quarkus tips, tricks, and techniques
Quarkus tips, tricks, and techniquesQuarkus tips, tricks, and techniques
Quarkus tips, tricks, and techniquesRed Hat Developers
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux KernelDocker, Inc.
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and HowSneha Inguva
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageejlp12
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
How to Survive an OpenStack Cloud Meltdown with Ceph
How to Survive an OpenStack Cloud Meltdown with CephHow to Survive an OpenStack Cloud Meltdown with Ceph
How to Survive an OpenStack Cloud Meltdown with CephSean Cohen
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringShapeBlue
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 

Tendances (20)

Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistence
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking Jenkins
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation docker
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backend
 
From Zero to Docker
From Zero to DockerFrom Zero to Docker
From Zero to Docker
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Quarkus tips, tricks, and techniques
Quarkus tips, tricks, and techniquesQuarkus tips, tricks, and techniques
Quarkus tips, tricks, and techniques
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
How to Survive an OpenStack Cloud Meltdown with Ceph
How to Survive an OpenStack Cloud Meltdown with CephHow to Survive an OpenStack Cloud Meltdown with Ceph
How to Survive an OpenStack Cloud Meltdown with Ceph
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uring
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 

En vedette

Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetesSamuel Terburg
 
OpenShift Overview
OpenShift OverviewOpenShift Overview
OpenShift Overviewroundman
 
OpenShift on OpenStack
OpenShift on OpenStackOpenShift on OpenStack
OpenShift on OpenStackDave Neary
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container PlatformDLT Solutions
 
DEVNET-1183 OpenShift + Kubernetes + Docker
DEVNET-1183	OpenShift + Kubernetes + DockerDEVNET-1183	OpenShift + Kubernetes + Docker
DEVNET-1183 OpenShift + Kubernetes + DockerCisco DevNet
 
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandPaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandCisco IT
 
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...OpenShift Origin
 
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...OpenShift Origin
 
How to Monitoring the SRE Golden Signals (E-Book)
How to Monitoring the SRE Golden Signals (E-Book)How to Monitoring the SRE Golden Signals (E-Book)
How to Monitoring the SRE Golden Signals (E-Book)Siglos
 

En vedette (9)

Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetes
 
OpenShift Overview
OpenShift OverviewOpenShift Overview
OpenShift Overview
 
OpenShift on OpenStack
OpenShift on OpenStackOpenShift on OpenStack
OpenShift on OpenStack
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
DEVNET-1183 OpenShift + Kubernetes + Docker
DEVNET-1183	OpenShift + Kubernetes + DockerDEVNET-1183	OpenShift + Kubernetes + Docker
DEVNET-1183 OpenShift + Kubernetes + Docker
 
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandPaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
 
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
 
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
 
How to Monitoring the SRE Golden Signals (E-Book)
How to Monitoring the SRE Golden Signals (E-Book)How to Monitoring the SRE Golden Signals (E-Book)
How to Monitoring the SRE Golden Signals (E-Book)
 

Similaire à Docker and Go: why did we decide to write Docker in Go?

Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionJérôme Petazzoni
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersDocker, Inc.
 
Pentester++
Pentester++Pentester++
Pentester++CTruncer
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016maiktoepfer
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Jérôme Petazzoni
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.UA Mobile
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and ContainersDocker, Inc.
 
Javascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsJavascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsClay Smith
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyJérôme Petazzoni
 
Docker for developers
Docker for developersDocker for developers
Docker for developersDrupalDay
 
Docker for developers
Docker for developersDocker for developers
Docker for developerssparkfabrik
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 

Similaire à Docker and Go: why did we decide to write Docker in Go? (20)

Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
Pentester++
Pentester++Pentester++
Pentester++
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Headless Android
Headless AndroidHeadless Android
Headless Android
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Javascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsJavascript Apps at Build Artifacts
Javascript Apps at Build Artifacts
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Sonatype DevSecOps Leadership forum 2020
Sonatype DevSecOps Leadership forum 2020Sonatype DevSecOps Leadership forum 2020
Sonatype DevSecOps Leadership forum 2020
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
JOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to ProductionJOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to Production
 

Plus de Jérôme Petazzoni

Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Jérôme Petazzoni
 
Orchestration for the rest of us
Orchestration for the rest of usOrchestration for the rest of us
Orchestration for the rest of usJérôme Petazzoni
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Jérôme Petazzoni
 
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...Jérôme Petazzoni
 
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...Jérôme Petazzoni
 
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...Jérôme Petazzoni
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
How to contribute to large open source projects like Docker (LinuxCon 2015)
How to contribute to large open source projects like Docker (LinuxCon 2015)How to contribute to large open source projects like Docker (LinuxCon 2015)
How to contribute to large open source projects like Docker (LinuxCon 2015)Jérôme Petazzoni
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Jérôme Petazzoni
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConJérôme Petazzoni
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Jérôme Petazzoni
 
Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015Jérôme Petazzoni
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Jérôme Petazzoni
 
The Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deploymentThe Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deploymentJérôme Petazzoni
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of usJérôme Petazzoni
 
Docker Non Technical Presentation
Docker Non Technical PresentationDocker Non Technical Presentation
Docker Non Technical PresentationJérôme Petazzoni
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionJérôme Petazzoni
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJérôme Petazzoni
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Jérôme Petazzoni
 

Plus de Jérôme Petazzoni (20)

Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...
 
Orchestration for the rest of us
Orchestration for the rest of usOrchestration for the rest of us
Orchestration for the rest of us
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
 
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
 
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
 
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
How to contribute to large open source projects like Docker (LinuxCon 2015)
How to contribute to large open source projects like Docker (LinuxCon 2015)How to contribute to large open source projects like Docker (LinuxCon 2015)
How to contribute to large open source projects like Docker (LinuxCon 2015)
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)
 
Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)
 
The Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deploymentThe Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deployment
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of us
 
Docker Non Technical Presentation
Docker Non Technical PresentationDocker Non Technical Presentation
Docker Non Technical Presentation
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 

Dernier

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Dernier (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Docker and Go: why did we decide to write Docker in Go?

  • 1. Docker: an insider view Google Developers Group Meetup November 2013, Google West Campus 2 Michael Crosby — @crosbymichael Jérôme Petazzoni — @jpetazzo Victor Vieux — @vieux
  • 2. Outline ● ● ● ● ● ● what is Docker why it is written in Go some implementation details drawbacks more drawbacks discussion
  • 4. Docker solves the “Matrix from Hell”
  • 5. Docker solves the “Matrix from Hell”
  • 6. Docker solves the “Matrix from Hell” static website ? ? ? ? ? ? web frontend ? ? ? ? ? ? background workers ? ? ? ? ? ? user DB ? ? ? ? ? ? analytics DB ? ? ? ? ? ? queue ? ? ? ? ? ? dev VM QA server single prod server on-site cluster public cloud contributor laptop
  • 8. Worldwide shipping: another Matrix from Hell clothes ? ? ? ? wine ? ? ? ? coffee ? ? ? ? electronics ? ? ? ? cars ? ? ? ? raw materials ? ? ? ? ships trains trucks storage
  • 9. Solution: the intermodal shipping container clothes wine coffee electronics cars raw materials ships trains trucks storage
  • 10. Solution to the deployment problem: the Linux container
  • 11. What’s a Linux container? High level approach Chroot on steroids ● normal processes, but isolated ● share kernel with the host ● no device emulation (neither PV nor HVM) ● doesn’t need a /sbin/init (runs the app/DB/whatever directly) “Application Container”
  • 12. What’s a Linux container? Low level approach Lightweight Virtual Machine ● own process space ● own network interface ● can run stuff as root ● can have its own /sbin/init (different from the host) “Machine Container”
  • 13. Separation of concerns: Dave, from the dev team ● ● ● ● ● ● ● my code my framework my libraries my system dependencies my packaging system my distro my data I don’t care where it’s running or how.
  • 14. Separation of concerns: Oscar, from the ops team ● ● ● ● ● logs backups remote access monitoring uptime I don’t care what’s running in it.
  • 15. OK, so what’s Docker?
  • 16. Runtime for Linux containers jpetazzo@tarrasque:~$ sudo docker run -t -i ubuntu bash root@092ee318746f:/# jpetazzo@tarrasque:~$ sudo docker run -d johncosta/redis c6000fa5ddc6 jpetazzo@tarrasque:~$ sudo docker inspect c6000fa5ddc6 ... "NetworkSettings": { "IPAddress": "172.17.0.8", "Ports": { "6379/tcp": null } ...
  • 17. Standard format for containers, and a place to share them ● fetch an image from the registry with “docker pull” ● enter the image with “docker run”, do some changes ● record those changes with “docker commit”, repeat as many time as needed ● then share the result with “docker push”, on the public registry or on a private one
  • 18. Why Go? The Five Reasons Why We Used Go
  • 19. Why Go? 1) static compilation ● “go build” will embed everything you need (no more “install this in order to run my stuff”) ● … except dynamic libraries if you use cgo (cgo lets you use any C library) ● and … except libc (but who doesn’t have libc?) ● you can have a real static binary (if you hack the build process a bit…)
  • 20. Why Go? 1) static compilation ● easier to install, easier to test, easier to adopt ● good candidate for bootstrap (i.e. the first installed thing, which will install the other things) ● “no dependencies? me gusta!” -- Anonymous BOFH
  • 21. Why Go? 2) neutral ● ● ● ● it’s not C++ it’s not Python it’s not Ruby it’s not Java
  • 22. Why Go? 3) it has what we need ● good asynchronous primitives (wait for I/O, wait for processes…) ● low-level interfaces (manage processes, syscalls…) ● extensive standard library and data types ● strong duck typing
  • 23. Why Go? 4) full development environment Go addresses multiple issues of the development workflow. ● ● ● ● ● go doc (see documentation for any package) go get (fetch dependencies on github etc.) go fmt (solve “tabs vs. spaces” once for all) go test (runs all Test* functions in *_test.go) go run (rapid script-like prototyping)
  • 24. Why Go? 5) multi-arch build ...without pre-processors _linux.go _darwin.go
  • 25. Drawbacks Because that’s the most interesting thing in Amazon reviews
  • 26. “Go doesn’t solve any problem” Jonn Mostovoy @podmostom29 Sep @benoitc @arnaudsj in not solving any problems. Everything they claim to solve is better solved in Dv2. 0, Erlang or will be solved in Rust.. But... ● Go is easier than Erlang ● Go is more real than Rust ● Don’t know about D 2.0 though!
  • 27. maps aren’t thread-safe ● deliberate decision: they’re fast (and it’s up to you to ensure that they’re safe) ● you have to protect access with sync.Mutex ● or, use channels of channels! m := NewMap() response := make(chan string) m<-Get{Key: “fortytwo”, Replyto: response} value := <-response
  • 28. go get ● can’t pin a particular revision ● Docker had to vendor all dependencies (i.e. import their source code in our repo) ● must deal with private repos manually
  • 29. go test ● can’t have destructors/cleanups/… in tests ● use a test named “z_final_test.go” ● … which doesn’t work too well when running individual tests!
  • 30. go build ● it’s painful to build multiple binaries, when they share some common code ● each program has to be in its own package, and package must be “main” ● you have to put shared/common stuff aside, or use named import tricks (bleh)
  • 31. flag package ● doesn’t handle short/long options (-o --option) ● doesn’t handle options grouping (-abc -a -b -c) ● seriously just don’t use it (use getopt or go-flags instead) unless your primary target is Plan9 of course!
  • 32. no IDE Let’s ask Samuel Jackson what he thinks about it
  • 33.
  • 34.
  • 35. Error handling can be verbose if err := openFile(); err != nil { return err } if err := readAll(); err != nil { return err } if err := closeFile(); err != nil { return err } ...
  • 36. Error handling ● panic / recover (don’t abuse it; only use it internally!) ● deploy one-off utility types http://talks.golang.org/2013/bestpractices.slide#5
  • 37. can’t select on readers/writers select { case data = <-inputChannel: … case data = <-otherInputChannel: … case data = connection.Read(): … }
  • 38. can’t select on readers/writers ● for readers: ○ start a goroutine with access to an output channel ○ the goroutine do blocking reads on the readers… ○ …and pushes the results on the output channel ● for writers: ○ adaptation is left as an exercise for the reader → reduce everything to channels!
  • 39. Some useful resources: ● The Holy Reference: http://golang.org/ref/spec ● Some useful patterns: http://golang.org/doc/effective_go.html ● Some best practices: http://talks.golang.org/2013/bestpractices.slide ● Embedded documentation: godoc -http=:6060 & chrome http://localhost:6060 Michael Crosby — @crosbymichael Jérôme Petazzoni — @jpetazzo Victor Vieux — @vieux
  • 40. Thank you! Questions? Michael Crosby — @crosbymichael Jérôme Petazzoni — @jpetazzo Victor Vieux — @vieux