8 ms·
Getting Docker to run on Linode
- amitdugar 13y agoI am new to this. Docker lets us use same set of configs so that we have uniform server setup everywhere right ? How is this different from Vagrant ? Or did I miss something ?
- _phred 13y agoLooks like it's built around KVM (Kernel Virtualization Modules), i.e. "containers", rather than full-blown virtual machine emulation like Xen or VirtualBox/Vagrant. It appears to be a configuration management / deployment tool for KVM containers. New to me too, gonna dive in and check it out.
- nickstinemates 13y agoThat's a great way to describe it. It's a "lightweight" VM that is created per process.
- deleted 13y ago[deleted]
- jmillikin 13y agonitpicking: KVM stands for "Kernel Virtual Machine". It's an implementation of virtual machines, just like VirtualBox or VMWare. Containers are completely separate from KVM.
- lotyrin 13y agoKVM is full machine emulation (i.e. hardware is emulated, and you can run different kernels inside the guests than you do on the host). Docker uses LXC which is like BSD Jails, most of the advantages of VMs but you don't have to emulate a whole system, there's only one kernel atop which multiple containers/jails can run different software and have thorough isolation. Very fast and light-weight, but you can't run different OS kernels.
- shykes 13y agoThey are complementary. Vagrant is a tool for configuring VMs for development. Docker is a tool for packaging your code and all its dependencies into a portable lightweight container. You can deploy docker containers across VMs and physical machines, regardless of how they are configured. Some of your machines may be configured with Vagrant, some of them with Puppet, Chef, Salt or any number of home-made tools. But all of them can run your docker container exactly as you built it, byte for byte.
- gingerlime 13y agoInteresting. Does this also mean you can run your container on both 64 and 32 bit platforms?
- shykes 13y agoYes, although only x86_64 is officially supported at the moment, that should change very soon.
- shykes 13y agoOther instructions to get started with docker: * Docker on Rackspace: http://blog.docker.io/2013/05/running-docker-on-rackspace/ http://blog.docker.io/2013/05/running-docker-on-rackspace/ * Docker on Digital Ocean: http://blog.docker.io/2013/06/running-docker-on-digital-ocean-with-ubuntu/ http://blog.docker.io/2013/06/running-docker-on-digital-ocea... If you have installed docker on another hosting provider and want to share your notes, let me know.
- nickstinemates 13y agoThanks a bunch for posting this, shykes. :)
- shykes 13y agoKen Cochrane also compiled a huge list of docker-related resources here: https://github.com/dotcloud/docker/issues/614 https://github.com/dotcloud/docker/issues/614 Thanks, Ken!
- silasb 13y agoI have one for getting it on Chunkhost. http://sbaronda.com/2013/05/05/getting-docker-on-chunkhost/ http://sbaronda.com/2013/05/05/getting-docker-on-chunkhost/
- KenCochrane 13y agoThank you, I have added it to https://github.com/dotcloud/docker/issues/614 https://github.com/dotcloud/docker/issues/614 Would you be interested in submitting a pull request to add it to the official docs?
- silasb 13y agoI could probably do that. Do you just want an acknowledgement that Docker works with Chunkhost or something more detailed?
- KenCochrane 13y ago
- nickstinemates 13y agoI want to add that, my site is so far a bit pre-mature for all of this traffic. I added some more content but linked to the article in the top post. I'll be implementing a more "real" blog shortly, but that's part of the development process of this blog. Feedback is much appreciated. And feel free to come say hi in #docker on freenode.
- shykes 13y agoDoes your blog itself run on docker?
- nickstinemates 13y agoYep!
- shykes 13y agoAwesome :)
- andrewmunsell 13y agoMy one primary issue right now with Docker is that it's a little difficult to get something like Apache going, since it's a service. Docker obviously detects the command I pass in as finished, and then stops the container. Here it's solved by turning the nginx daemon off and running the command directly, but is there a better way to run something like Apache (which runs as a service) to host PHP applications, without resorting to sending long running commands like "while true; sleep 1; done"? I guess this kind of defeats the purpose of Docker, in a sense, since the project's more about isolating applications (which generally run as a long running process, a la Node.js). But, PHP is still a popular platform for development and I'd love to be able to try out Docker for some of my own PHP stuff versus spinning up entire VMs with Vagrant.
- shykes 13y agoHey Andrew, you can definitely run Apache+php as a docker container. Apache can run in the foreground with "httpd -D FOREGROUND", so that docker can monitor it. Then add a few layers to your Dockerfile with php, mod_php, 3d party php packes and your own code - you should be ready to go. Having docker monitor a foreground process has many advantages over the traditional "init script + self-daemonize" approach. Mostly it avoids reinventing the wheel. For example each process doesn't have to worry about logging, service registration/discovery, etc. I would argue it is closer to the Unix way :)
- sneak 13y agoIt also has the added advantage of stopping (and presumably automatically restarting, or at least triggering an alarm) a container when the service dies, something a daemonized version with a "while true; sleep" one would not. This is something baked into the design of djb's daemontools (as well as later efforts in that realm like launchd and upstart), something the traditional shell-script startup stuff always got wrong. Failure detection is your friend.
- andrewmunsell 13y agoYeah, I guess that makes sense. Thanks for the response!
- zimbatm 13y agoHow do you get the repo's files into the Dockerfile build context ? Do you have to install git and then `git clone` or are these available at a specific path inside the container ?
- nickstinemates 13y agoUse the ADD command. ADD <folder/on/host> </mount/point/on/image>
- shykes 13y agoMore specifically it's: ADD <folder/on/sourcedir> </mount/point/on/image> When <sourcedir> is the directory you're passing to 'docker build', eg. "docker build ./myapp"
- lreeves 13y ago"curl http://get.docker.io http://get.docker.io | sh" - what reason would there be to not use SSL here?
- nickstinemates 13y agohttps is not available for the site. The script doesn't seem particularly sensitive, is it?
- adamonduty 13y agoSo that someone between you and http://get.docker.io http://get.docker.io doesn't decide to replace the script with their own special version that runs as root on your box.
- lreeves 13y agoSorry, I realize that. I mean, you're asking people to literally pipe data into their shell from a website and you're not using HTTPS. That seems lax to me.
- shykes 13y agoThere's an ongoing issue for this [1]. The script is currently hosted on an S3 bucket which doesn't support SSL access via the CNAME. We're migrating it to a separate server. [1] https://github.com/dotcloud/docker/pull/648 https://github.com/dotcloud/docker/pull/648
- durzagott 13y agoI really want start getting my hands dirty with Docker and give it a good evaluation. However, until they can support using a proxy server, it's dead-on-arrival for me. I filed a bug report and even been on to the IRC channel to chat to the devs, but no-one seems interested. Developers of the world: a large number of people will experiment with your products at work and a large number of work places use proxies. Don't forget about us when you invent a shiny new toy!
- KenCochrane 13y agoWhat do you mean by support using a proxy server? Can you put a link to the Docker ticket, and I'll take a look.
- durzagott 13y agoSure thing: https://github.com/dotcloud/docker/issues/813 https://github.com/dotcloud/docker/issues/813 What I mean is, that in order to pull from the repository (eg, docker pull base) I need to connect using a proxy server.
- KenCochrane 13y agoI see, thanks. I'll see if I can get someone to look at it.