Upload
rohit-jnagal
View
59
Download
1
Embed Size (px)
Citation preview
Docker and Co.container news from the wild
Rohit Jnagal jnagal@
Johan Euphrosine proppy@
Docker 1.5● Docker build -f demo● Relative ADD/COPY● Docker Stats demo● Read-only container demo ● Docker run --pid demo● Docker run --memory-*● faster docker push● exec in inspect, OOM support
Handling relative ADD/COPY
FROM busybox
RUN echo "root?" > test1.txt
RUN mkdir /test2
WORKDIR /test2
RUN echo "test2" > test2.txt
#ENTRYPOINT ["/usr/bin/pwd"]
ADD add1 .
ADD add2 ./
ADD add3 ./add3_rename
ADD add4 add4
Docker 1.5● Docker build -f demo● Relative ADD/COPY● Docker Stats demo● Read-only container demo ● Docker run --pid demo● Docker run --memory-*● faster docker push● exec in inspect, OOM support
Handling relative ADD/COPY
FROM busybox
RUN echo "root?" > test1.txt
RUN mkdir /test2
WORKDIR /test2
RUN echo "test2" > test2.txt
#ENTRYPOINT ["/usr/bin/pwd"]
ADD add1 .
ADD add2 ./
ADD add3 ./add3_rename
ADD add4 add4
DEMO...
Docker images● Shrinking the base images
○ progrium/busybox [ 4.7 MB ]■ hard to add dependencies
○ smallest full OS image [ debian: 85 MB ]○ Alpine [ 5.0 MB ]
■ Get to useful images with much less.■ from mini-containers/base■ Demo
● Docker image specification○ go2docker demo○ systemd-import
■ systemd-import pull-dck mattdm/fedorasystemd-nspawn -M fedora
import-dck.c#define INDEX_HOST "index.do" /* the URL we get the data from */ "cker.io"#define HEADER_TOKEN "X-Do" /* the HTTP header for the auth token */ "cker-Token:"#define HEADER_REGISTRY "X-Do" /*the HTTP header for the registry */ "cker-Endpoints:"
DEMO...
Docker Machine● Creating docker hosts on local and cloud providers● docker create machine --driver=google --google-project=... <machine-name>● Provides config params to talk to remote docker daemon
○ machine config <docker-machine>○ docker $(machine config docker-machine) run busybox echo hello world
● machine lsNAME ACTIVE DRIVER STATE URLdocker-machine * google Running tcp://130.201.160.230:2376
● Quirks: versioning● containervm can do that with manifest for containers with added replicas and auto-scaling.● Support:
○ Virtualbox,○ Digital Ocean, ○ Microsoft Azure, Amazon EC2, GCE, ○ VMWare Fusion/vSphere/vCloud,○ OpenStack
DEMO...
Docker Swarm● Docker native clustering system● Discovery
○ Static list of IPs or hostfile○ etcd, consul, zookeeper
● No bootstrapping● Filters: port, affinity, constraint, health
○ constraints: docker daemon node attributes○ constraints: standard constraints○ affinity: container, image○ port allocation○ health: avoid unhealthy
● Scheduling strategy:○ Binpacking○ Random
● Compose: docker up a group of containers. DEMO...
● Stage 0○ Gets the image and sets up root container/manifest for later stages○ Execs stage1: /stage1/rootfs/init
● Stage 1○ Generate systemd unit files for application and container manifests.○ Setup cgroups, namespaces, mounts.○ Launch root systemd
● Stage 2○ Launch Manifest
● Systemd is the pod manager○ takes cares of ordering, restarts, and health checks of containers.
● demo
DEMO...
Others
● Weave○ Network fabric for connecting containers.
● Flocker○ Container migration w/ data.
● Dokku○ single host heroku○ Sponsored by Deis
● Plugins on the way... DEMO...
That’s it
Thanks
Catch me offline for more demo-time.