SlideShare a Scribd company logo
1 of 40
Download to read offline
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

More Related Content

What's hot

CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & DockerJoerg Henning
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOpsNicola Baldi
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Rootless Containers
Rootless ContainersRootless Containers
Rootless ContainersAkihiro Suda
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting startedMatheus Marabesi
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdBilly Yuen
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull RequestKasper Nissen
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfWeaveworks
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Containerd internals: building a core container runtime
Containerd internals: building a core container runtimeContainerd internals: building a core container runtime
Containerd internals: building a core container runtimeDocker, Inc.
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 

What's hot (20)

CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Rootless Containers
Rootless ContainersRootless Containers
Rootless Containers
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker and Devops
Docker and DevopsDocker and Devops
Docker and Devops
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdf
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Containerd internals: building a core container runtime
Containerd internals: building a core container runtimeContainerd internals: building a core container runtime
Containerd internals: building a core container runtime
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 

Viewers also liked

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
 

Viewers also liked (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)
 

Similar to 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
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to productionmuayyad alsadi
 

Similar to 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...
 
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
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
 

More from 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
 

More from 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 ...
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging 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 textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

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