Interoperable Containers

46
interoperable containers Fabio Kung [email protected] https://www.flickr.com/photos/usnavy/8612337045

description

 

Transcript of Interoperable Containers

Page 1: Interoperable Containers

interoperable

containers

Fabio [email protected]

https://www.flickr.com/photos/usnavy/8612337045

Page 2: Interoperable Containers

Fabio, Runtime Systems at

I run linux containers.

Page 3: Interoperable Containers

http://12factor.net

Page 4: Interoperable Containers

“write once, run everywhere– Sun Microsystems (?)

Page 5: Interoperable Containers

“write once, debug everywhere– (?)

Page 6: Interoperable Containers

https://www.flickr.com/photos/tjblackwell/3545764529

Page 7: Interoperable Containers

Developers want apps...

https://www.flickr.com/photos/cyol/7642566946

Page 8: Interoperable Containers

PaaS wants scale...

https://www.flickr.com/photos/johngarghan/3401814659

Page 9: Interoperable Containers

Docker wants...

docker logo usage follows guidelines published at http://www.docker.com/marks_and_logos/

Page 10: Interoperable Containers
Page 11: Interoperable Containers

PaaS

You

dockerlxc

lmctfy...

background: https://www.flickr.com/photos/jdhancock/12397433023

Page 12: Interoperable Containers

Containershttps://www.flickr.com/photos/joshua/433354324

Page 13: Interoperable Containers

“trying to make Docker secure for multi-tenant scenarios is a can of worms

– darren0, at #docker-dev

Page 14: Interoperable Containers

1 vs 1M

https://www.flickr.com/photos/enerva/9068467267

Page 15: Interoperable Containers

Roothttps://www.flickr.com/photos/ashleyrosex/2861690380

Page 16: Interoperable Containers

apt-get install …

Page 17: Interoperable Containers

vi /etc/…

Page 18: Interoperable Containers

mount -t fancy …

Page 19: Interoperable Containers

modprobe something

Page 20: Interoperable Containers

iptables -A INPUT …

Page 21: Interoperable Containers

kernelspace abuse

https://www.flickr.com/photos/erlendaasland/4107345124

Page 22: Interoperable Containers

User NamespacesUnprivileged Containers

https://www.flickr.com/photos/ntr23/730371240

Page 23: Interoperable Containers

“(…) the kernel grants all capabilities to the initial process in a user namespace, this does not mean that process then has superuser privileges within the wider system. (It may, however, mean that unprivileged users now have access to exploits in kernel code that was formerly accessible only to root, ...)

– Michael Kerrisk, “Namespaces in operation, part 6: more on user namespaces", LWN.net

Page 24: Interoperable Containers

if (getuid() == 0) { // do root stuff}

Page 25: Interoperable Containers

just don't run as root?

Page 26: Interoperable Containers

also SUID

Page 27: Interoperable Containers

Restrictions

https://www.flickr.com/photos/mollivan_jon/10431164633

Page 28: Interoperable Containers

Networking

https://www.flickr.com/photos/emptyage/177466621

Page 29: Interoperable Containers

ephemeral disks

https://www.flickr.com/photos/pixeltree/4876732522

Page 30: Interoperable Containers

arch, OS, image size, …

Page 31: Interoperable Containers

containers/container-rfc · GitHub

“A vendor neutral format for Linux container images and runtime

Page 32: Interoperable Containers

https://www.flickr.com/photos/littlebiglens/6034320322

Image Size

Page 33: Interoperable Containers

Layers

https://www.flickr.com/photos/ralan808/11300490173

Page 34: Interoperable Containers

Updates?

noncommercial use

Page 35: Interoperable Containers

https://www.flickr.com/photos/doug88888/2801103568

Packages“slugs”

Page 36: Interoperable Containers

dotcloud/docker#332

docker load --rebase=new-base-image

Page 37: Interoperable Containers

Appshttps://www.flickr.com/photos/zoomar/338952152

Page 38: Interoperable Containers

Buildpacksapp source + base image

Page 39: Interoperable Containers

FROM heroku/cedar

ADD . /buildpackONBUILD ADD . /appONBUILD RUN /buildpack/bin/compile /appONBUILD ENV PORT 5000ONBUILD EXPOSE 5000

Page 40: Interoperable Containers

`ONBUILD ONBUILD`dotcloud/docker#5714

Page 41: Interoperable Containers

Buildstephttps://github.com/progrium/buildstep

Page 42: Interoperable Containers

https://github.com/radial/

Page 43: Interoperable Containers

#!/usr/bin/env make -f

buildpath := .buildbuildpackpath := $(buildpath)/packbuildpackcache := $(buildpath)/cache

build: $(buildpackpath)/bin $(buildpackpath)/bin/compile . $(buildpackcache)

$(buildpackcache): mkdir -p $(buildpath) mkdir -p $(buildpackcache) curl -O https://codon-buildpacks.s3.amazonaws.com/.../go.tgz mv go.tgz $(buildpath)

$(buildpackpath)/bin: $(buildpackcache) mkdir -p $(buildpackpath) tar -C $(buildpackpath) -zxf $(buildpath)/go.tgz

Page 44: Interoperable Containers

ruby = "https://codon-buildpacks.s3.amazonaws.com/.../ruby.tgz"

app_container "myapp" do buildpack ruby git_url "[email protected]:myapp.git"end

define :app_container, name: nil, buildpack: nil, git_url: nil do # ...

execute "#{name} buildpack compile" do command "#{dir}/.build/pack/bin/compile #{dir} .build/cache" endend

Page 45: Interoperable Containers

container centric: whole image

app centric: builds as a mapping layer

recap: the container revolution

Page 46: Interoperable Containers

Thank you!

[email protected]

All images used in this presentation are under a Creative Commons License, unless otherwise notedhttps://www.flickr.com/photos/compacflt/5948542359