Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What is Docker?

Nils De Moor
February 19, 2014

What is Docker?

Docker Belgium meetup #1 notes on what Docker is and how it can be used.

Nils De Moor

February 19, 2014
Tweet

More Decks by Nils De Moor

Other Decks in Programming

Transcript

  1. • Nils De Moor • CTO & co-founder at WooRank

    • #node #mongo #ansible #automation #devops About me
  2. • LXC Containers • “Chroot on steroids” • AUFS •

    layered view on merged directories • copy-on-write What and how?
  3. • Install docker in vagrant box • Execute commands “Hello

    world” docker run ubuntu echo Hello World docker run ubuntu touch /tmp/test docker ps -a docker diff [CONTAINER_ID] docker run -d ubuntu /bin/sh -c "while true; do date; sleep 1; done" docker ps docker logs [CONTAINER_ID]
  4. FROM ubuntu # make sure the package repository is up

    to date RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update # install memcached RUN apt-get install -y memcached # run as user daemon (memcached doesn't allow to run as root) USER daemon # expose memcached port EXPOSE 11211 # Launch memcached when launching the container ENTRYPOINT ["memcached"]
  5. • Public image repository • Similar to npm, PyPI, bower,

    apt, yum, ... • Trusted builds • Search from docker cli • https://index.docker.io Docker index
  6. FROM ubuntu ENV NODE_VERSION 0.10.24 # Install common packages RUN

    apt-get update RUN apt-get install -y wget # Install node RUN mkdir /opt/node-$NODE_VERSION RUN wget -O /tmp/node-$NODE_VERSION.tar.gz http://nodejs.org/ dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz RUN tar zxf /tmp/node-$NODE_VERSION.tar.gz --strip-components=1 --no-same-owner -C /opt/node-$NODE_VERSION RUN ln -s /opt/node-$NODE_VERSION/bin/node /usr/local/bin/node RUN ln -s /opt/node-$NODE_VERSION/bin/npm /usr/local/bin/npm ADD . /var/www RUN cd /var/www && npm install EXPOSE 3000 CMD [ "node", "/var/www/server.js" ]
  7. # run memcache container docker run -d -name memcache dockerbel/memcached

    # run app container, linked to memcache container docker run -d -p 3000:3000 -e ENV=dev -link memcache:mc -v /tmp/log/app:/var/log/app:rw -name app dockerbel/app
  8. • Maturity (1.0 in the next months) • Pluggable approach

    • Wider OS support • More filesystem options What’s next?
  9. • Deis - deployment and orchestration • Dokku - deployment

    • Fig - deployment • Flynn - deployment and orchestration • Shipyard - monitoring Community