Docker in Ubuntu, Ubuntu in Docker

We’re excited to include the following guest blog post by our friend Dustin Kirkland, Ubuntu Cloud Product Manager at Canonical

There is a design pattern, occasionally found in nature, when some of the most elegant and impressive solutions often seem so intuitive, in retrospect.

For me, Docker is just that sort of game changing, hyper-innovative technology, that, at its core,  somehow seems straightforward, beautiful, and obvious.

Linux containers, repositories of popular base images, snapshots using copy-on-write filesystem features.  Brilliant, yet so simple.  Docker.io for the win!

I clearly recall nine long months ago, intrigued by a fervor of HackerNews excitement pulsing around a nascent Docker technology.  I followed a set of instructions on a very well designed and tastefully manicured web page, in order to launch my first Docker container.  Something like: start with Ubuntu 13.04, downgrade the kernel, reboot, add an out-of-band package repository, install an oddly named package, import some images, perhaps debug or ignore some errors, and then launch.  In few moments, I could clearly see the beginnings of a brave new world of lightning fast, cleanly managed, incrementally saved, highly dense, operating system containers.  Ubuntu inside of Ubuntu, Inception style.  So.  Much.  Potential.

Fast forward to today — April 18, 2014 — and the combination of Docker and Ubuntu 14.04 LTS has raised the bar, introducing a new echelon of usability and convenience, and coupled with the trust and track record of enterprise grade long term support from Canonical and the Ubuntu community.  (Big thanks, by the way, to Paul Tagliamonte, upstream Debian packager of Docker.io, as well as all of the early testers and users of Docker during the Ubuntu development cycle.)

Docker is now officially in Ubuntu.  That makes Ubuntu 14.04 LTS the first enterprise grade Linux distribution to ship with Docker natively packaged, continuously tested, and instantly installable.  Millions of Ubuntu servers are now never more than three commands away from launching or managing Linux container sandboxes, thanks to Docker.

sudo apt-get install docker.io
sudo docker.io pull ubuntu
sudo docker.io run -i -t ubuntu /bin/bash

And with that command, Ubuntu is now officially in Docker, on your server.  You are now inside of shell in your very own Linux container.  Brilliant, simple, elegant, user friendly.  Just the way we like things in Ubuntu, thanks to our friends at Docker.

Cheers,

:-Dustin

 

23 Responses to “Docker in Ubuntu, Ubuntu in Docker”

  1. junwen38

    2014/04/19 01:45:56 dial unix /var/run/docker.sock: no such file or directory

    Reply
  2. Mehdi

    Why do Ubuntu use docker.io as executable name instead of just docker? Tutorials, blog posts all now have to mention this difference, “if you use Ubuntu 14.04, or if you are with rest of the world (including earlier versions of Ubuntu)”. Why?

    Reply
  3. Dustin Kirkland: Docker in Ubuntu, Ubuntu in Docker | itux.info

    […] article is cross-posted on Docker’s blog as […]

    Reply
  4. Installing Docker.io on Ubuntu 14.04LTS - Windows Azure Blog

    […] i’m running a virtual machine in Windows Azure with the prebuild image for Ubuntu 14.04LTS. When i want to install Docker.io like described here: http://blog.docker.io/2014/04/docker-in-ubuntu-ubuntu-in-docker/ […]

    Reply
  5. Michael

    It seems to be in Universe, so not supported by Canonical, nor any garantee on support or security, that’s a bit disappointing. And hasn’t RHEL 6.5 have docker as well in EPEL since a few months ? And so, the affirmation “first entreprise grade linux distribution” is a bit misleading, since that’s neither the “first” nor “entreprise grade”.

    Reply
  6. Guy Baconniere

    # if you prefer docker over docker.io on Ubuntu 14.04 LTS…
    # dpkg -L docker.io | xargs grep -s ‘docker.io’

    # Create /usr/bin/docker the Debian/Ubuntu way
    # (avoid conflicting with docker – System tray)
    update-alternatives –install /usr/bin/docker docker /usr/bin/docker.io 50

    # Allow bash completion for docker
    cp -a /etc/bash_completion.d/docker{.io,}
    sed -i ‘s/(docker).io/1/g’ /etc/bash_completion.d/docker

    # Allow zsh completion for docker
    cp -a /usr/share/zsh/vendor-completions/_docker{.io,}
    sed -i ‘s/(docker).io/1/g’ /usr/share/zsh/vendor-completions/_docker

    # the man for docker
    ln -s /usr/share/man/man1/docker{.io,}.1.gz

    # not really needed because docker.io is still available /usr/bin/docker.io
    sed -i ‘s/(docker).io/1/g’ /usr/share/docker.io/contrib/*.sh

    # TODO?
    # /usr/share/lintian/overrides/docker.io
    # /usr/share/doc/docker.io

    Reply
  7. Guy Baconniere

    Use docker instead of docker.io on Ubuntu 14.04 LTS http://pastebin.com/raw.php?i=hm3y4vJy

    Reply
  8. Michael Stucki

    Why is the programm named “docker.io” and not just “docker” as referred to in any other tutorial? Does the package set an alias, or is it required to do so manually?

    Reply
  9. Thiago Martins

    Hey guys!

    I just did on my brand new Ubuntu 14.04:


    apt-get install docker.io
    docker.io pull ubuntu
    docker.io run -i -t ubuntu /bin/bash

    But… Within the docker container, I’m seeing:


    root@22650e7d8ef1:/# lsb_release -ra
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 12.04 LTS
    Release: 12.04
    Codename: precise

    So, no Ubuntu 14.04 version within a container yet?!

    Cheers!
    Thiago

    Reply
  10. Thiago Martins

    Okay, got it!

    Just pushed my own Ubuntu 14.04 image do index.docker.io, pretty cool! :-D

    docker.io run -t -i tmartinx/ubuntu-14.04-server-cloudimg /bin/bash

    https://index.docker.io/u/tmartinx/ubuntu-14.04-server-cloudimg/

    Available WorldWide! ;-)

    Tks!

    Reply
  11. Dustin Kirkland: Docker in Ubuntu, Ubuntu in Docker | Hi-tech news

    […] article is cross-posted on Docker’s blog as […]

    Reply
  12. orgoj

    Docker.io in Ubuntu 14.04 is old version 0.9.1. Don’t work with ansible. I prefer install docker from docker.io repo.

    Reply
  13. Bala Paranj

    This is very exciting! Can’t wait to try.

    Reply
  14. Bala Paranj

    When I run : sudo docker.io pull ubuntu
    I am getting the following error message:
    2014/04/23 12:06:58 dial unix /var/run/docker.sock: no such file or directory

    How can I fix it?

    Reply
  15. Hugh Acland

    I’m confused. You seem to say that docker is now native to Ubuntu 14.04 and then go on to explain how to install it?

    Reply
    • Jerome

      Hi Hugh,

      “Native” means that there is an official package in the upstream Ubuntu repository; so people can install it easily. However, Ubuntu 14.04 doesn’t come out of the box with Docker pre-installed — just like it doesn’t come out of the box with all the available software; otherwise the default install would be very big (dozens of GB). Not everyone wants every program pre-installed. But “native” here means that the install is just one command away!

      Reply
  16. Robert J. Berger

    When I did this I got docker version 0.9.1 and it says:

    Last stable version: 0.10.0, please update docker

    How do I update to 0.10.0?

    Reply
    • Jerome

      Hi Robert,

      As I write those lines, the package for 0.10.0 is not in the official Ubuntu repositories. If you want the latest version, you can check the Docker installation guide [1], which will walk you through the steps of installing from the Docker repositories. Or, you can just wait a little bit for the Ubuntu repository to pick up the new version ! :-)

      [1] http://docs.docker.io/installation/ubuntulinux/

      Reply
  17. Marten Hauville

    For step by step instructuons to install Docker with Shipyard GUI in Ubuntu 14.04 LTS Trusty Tahr, take a look at my blog article: http://hybridcloudburst.com/2014/04/28/docker-io-shipyard-ubuntu-14-04-trusty-tahr-install/

    Reply
  18. How to manage Linux containers with Docker on Ubuntu - Linux FAQ

    […] a de-facto standard for container technologies, being embraced in major Linux distros such as Ubuntu and Red […]

    Reply

Leave a Reply