• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Manage Docker with Vagrant on OpenStack Cloud Server

By Abhishek Ghosh July 31, 2014 6:38 pm Updated on July 31, 2014

Manage Docker with Vagrant on OpenStack Cloud Server

Advertisement

Here is an easy guide on how to manage container Docker with Vagrant. This guide is tested on Rackspace Cloud Server and will work on all OpenStack IaaS. We already know what is Container Based Virtualization and how to use Docker on Cloud Server to Manage Containers. It is actually possible to Manage Docker with Vagrant on OpenStack Cloud Server – “Vagrant 1.6 comes with a new built-in provider: Docker”. We can not say whether it is possible to do with OpenShift Origin.

Disambiguation of the Names : OpenShift is Open Source PaaS software by RedHat, while OpenStack is intended for IaaS, initially developed by NASA and Rackspace. OpenShift can run on OpenStack, vice versa is not possible.

 

Manage Docker with Vagrant on OpenStack Cloud Server : Get Started

 

We will get started by installing Vagrant 1.6.x and Docker 1.1.x on Ubuntu Trusty (14.04 LTS) on Rackspace Performance 1 Flavor (PVHVM). While PVHVM is used for better performance, usage of 2GB instance (at this moment of publishing this article) will provide virtual dual core processor. Assuming that we are using a Mac (OS X 10.9.x) or any GNU Linux, we can use Docker on local computing via Boot2Docker :

Advertisement

---

Vim
1
2
3
4
# official instructions
https://docs.docker.com/installation/mac/
# github repo
https://github.com/boot2docker/boot2docker

Boot2Docker uses a Vagrant VirtualBox VM with Docker on it. As post installation process, we will set the environment variable VAGRANT_DEFAULT_PROVIDER :

Vim
1
2
3
4
5
6
# edit using nano
export VAGRANT_DEFAULT_PROVIDER=docker
# check version manually
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb && dpkg -i vagrant_1.6.3_x86_64.deb
# we are working via SSH - make sure that you have understood our plan
sudo apt-get install lxc-docker-1.1.1

We did it, so that Vagrant is forced to use Docker by default.

Manage Docker with Vagrant on OpenStack Cloud Server

 

Example of How We Can Manage Docker with Vagrant

 

We can create a vagrantfile to manage our Docker container based on this list of cookbook :

Vim
1
2
3
https://github.com/Krijger/docker-cookbooks
# example with mongo db
https://github.com/Krijger/docker-cookbooks/tree/master/mongo

You can use any of the recipe to test (or taste!). You can read about Vagrant configuration :

Vim
1
https://docs.vagrantup.com/v2/providers/configuration.html

If there is any problem with Path on VM (in case it is local computer), go to /vagrant/scripts and add the following line on setup.sh file :

Vim
1
echo "source /vagrant/scripts/export.sh" >> /home/vagrant/.bashrc

Below is an example vagrantfile, but look at the Docker hub first :

Vim
1
https://registry.hub.docker.com/u/quintenk/mongo/

This is an edited vagrantfile for mongo :

Vim
1
2
3
4
5
6
7
8
9
10
Vagrant.configure("2") do |config|
 
  config.vm.provider "docker" do |d|
    d.image           = "quintenk/mongo"
    d.has_ssh         = false
    d.ports           = ["27017:27017"]
    d.volumes      = ["/data/mongo:/root/.mongo"]
  end
 
end

For VM (local computer), the vagrant file might need some alteration.

This file contains a single configuration block as per documentation. docker notation declares a Docker instance and variable name is d, simply run Vagrant :

Vim
1
vagrant up

Note that, this IS A COMPLICATED example as it is mongo db and port can not be 8080. You can start with any cookbook which uses the port 8080.

Tagged With cloud computing tutorial , install docker cloud on boot2docker , openstack owncloud docker , ssh boot2docker cloud-config , vagrant file edit docker config , vagrant openstack get_api_version error
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Manage Docker with Vagrant on OpenStack Cloud Server

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress Local Development with Vagrant

    Here is a Guide For Wordpress Local Development with Vagrant. Vagrant is Better than MAMP, WAMP or XAMPP and is Related to Virtual Appliance.

  • How Setup Private Docker Registry on Ubuntu 16.04 LTS Cloud Server

    You Can Have Your Own Docker Registry on Own Cloud Server Instance. Here is How Setup Private Docker Registry on Ubuntu 16.04 LTS Cloud Server.

  • Analysis of Docker in DevOps : Part I

    Analysis of Docker in DevOps is a Series of Articles to Discuss the Solving Problems Arising within DevOps and Possible Fields of Application.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy