Tag Archives: machine

Using the released version of Docker-Machine (v0.1) with VMware vSphere

I began uplifting some of my content today which included upgrading to the newest docker (v1.5) and docker-machine (v0.1), and came across a number of changes.

  • The command is now officially “docker-machine” instead of just “machine” which is what it was when I first played with it.
  • All the VMware driver commands are now prefixed with “vmware”   so instead of “–vsphere-vcenter” it is now “–vmwarevsphere-vcenter”   a full example is:

    And they have an easier way to set the environment variables now:
  • I couldn’t get “–vmwarevsphere-boot2docker-url” to work with a custom URL which is probably a bug.  If you leave it out entirely it will use a default location.
  • ..Which is a good thing because boot2docker now includes VMware tools, which negates the need for a custom .ISO
  • The only other change I need to make to the boot2docker image is the use of a insecure registry, so I just include in my syntax the running of a shell script which runs: docker-machine ssh $1 sudo sed -i -e ‘s/–tlsverify/–tlsverify –insecure-registry docker-hub:5000/g’ /var/lib/boot2docker/profile  You can find this full shell script on github here.   “docker-hub” is my registry hostname on port 5000
  • I noticed the name of the VM now matches what docker-machine calls it instead of a random string.

That’s about it so far.  I have not used it too extensively yet but so far so good.  I did not see a single hang of the docker commands like I saw previously with the older versions.  Thumbs up so far.

Tagged , , , ,

How to modify a boot2docker .ISO for Docker Machine

I have been doing quite a bit of work with VMware vSphere + Docker + Machine lately.  I helped build a Hands On Lab for the recent VMware Partner Exchange conference with it.  I can’t promise, but it looks like it might be available publicly.  If you have access – it’s named HOL-SDC-1430.  It has been a difficult process as we’re in such alpha territory.  Things sometimes work, sometimes they don’t, and then they change a rev later..

Snip20150212_9An example of this is three specific items needed in a boot2docker image that is used as the docker host VM.  We need VMware tools (or open vm tools), some networking updates, and in my case the change to docker settings to allow pulling from an insecure local registry.

VMware’s Cloud Native Apps R&D has forked the main boot2docker repo and done the tools work and networking work (probably among others too) but I had to dive in and figure out how to edit it further to allow for a new docker option.  I really can’t claim to be an authoritative source on the docker and boot2docker side of things here but the googles failed me on a single location for all this information so here you go!

1) First you have to clone from a specific branch of VMware’s Cloud Native Apps git repo.  ovt stands for open vm tools.  See the diff’s here.

2) I found a Dockerfile is what is used to customize the iso.  How it works is the container is built from the file, and a number of other dependencies in the sub directories but is written to print out the iso data when run.  Pretty clever whoever first came up with this method.    So to do my hard-coding-not-best-practice-but-solves-my-needs I edit the Dockerfile as follows by removing the dependency on the b2d version, and just pull the latest Docker.   1.5 came out this week and I was wanting to pick up those updates.

Snip20150212_7

3) I also needed to use a local repository without certificates since I am building lab environments, so I added a new config variable for $DOCKER_REG to make it easier to update later.

Snip20150212_8

4) Now the rest is just following the b2d documentation.  Build the container with:

5) And write out the ISO with:

One thing that hung me up for a bit was machine doesn’t do any checksum on the ISO you tell it to use.   If machine sees the image already exists it WILL NOT overwrite it on the target datastore, so remember to delete it and let it upload the new one.  Very important.

Tagged , , , , ,

Alpha release of Docker Machine Driver for DigitalOcean

I make absolutely zero money on this blog.  Notice there are no ads anywhere on the page.  DigitalOcean has a referral program, so if you are interested in signing up please do a guy a favor and use this link.   Thanks!!!

I wrote about the VMware Fusion and VMware vSphere drivers for Docker Machine previously.  Since I’m playing with this new stuff and trying out DigitalOcean also, I thought I’d show how Machine & DigitalOcean work together.

Comparison
In short, it’s way easier to spin up than vSphere is at the current time, but I’m sure after some bug fixes that’ll get easier over time.  (I’ll try out VMware vCloud Air soon to be fair).  DigitalOcean uses their own image on the backend by default, so there is no downloading and uploading of a boot2docker image so net time to a container is really fast compared.  Also, there are only a handful of config settings (region, size, and image) and all of them are optional if you want to use the defaults.

Cost Savings?
As I am playing more and more with docker machine, I keep thinking about possible money savings this could bring to developers, and could push for a new cost model in public clouds.  Most providers that I have used (AWS, DigitalOcean..) you pay a flat rate by time (minutes, hours…) for compute and for the resources.  But it’s a flat charge, no change in cost for utilization.  Of course nominal charges for bandwidth but generally it’s so small, at least for dev/test it’s irrelevant.    So think about that.   If you spin up LESS overall machines now by plugging in docker machine into your CI or CD workflows by configuring Jenkins or whatever to deploy directly to a docker image inside a machine instead of directly to a cloud provider….. that could eventually save real money long term because you have much less individual workloads running and being billed for, though you may need a slightly larger shell machine.   This is like the cost savings that virtualization originally brought all over again in a way….

Video
Anyway, enough aimless ponderings.   Here is using machine with DigitalOcean:

I make absolutely zero money on this blog.  Notice there are no ads anywhere on the page.  DigitalOcean has a referral program, so if you are interested in signing up please do a guy a favor and use this link.   Thanks!!!

 

Tagged , , ,