Giter Club home page Giter Club logo

boot2docker-vagrant-box's Introduction

boot2docker Vagrant Box

This repository contains the scripts necessary to create a Vagrant-compatible boot2docker box and is compatible with Docker v1.6.

If you work solely with Docker, this box lets you keep your Vagrant workflow and work in the most minimal Docker environment possible.

Usage

The box is available on Hashicrop's Atlas, making it very easy to use it:

$ vagrant init dduportal/boot2docker
$ vagrant up

If you want the actual box source file, you can download it from the tags page.

On OS X, to use the docker client, follow the directions here: http://docs.docker.io/installation/mac/#docker-os-x-client (you'll need to export DOCKER_HOST). You should then be able to to run docker version from the host. Homebrew can also a good installation medium with brew update && brew install docker

Tips & tricks

  • Vagrant synced folder has been tested with :
    • vbox shared folder : This is default sharing system

    • rsync : add this line to your Vagrantfile (it will overwrite the default vboxsf sync behaviour) :

config.vm.synced_folder ".", "/vagrant", type: "rsync" ```

  • NFS : For now, use environment variable to enable NFS (Mac OS and Linux tested). It will ask for your admin password.

    $ export B2D_NFS_SYNC=1
    $ vagrant up
  • If you want to tune contents (custom profile, install tools inside the VM) that do not fit into the "vagrant provisionning" lifecycle combinded with the un-persistence of boot2docker, the "bootlocal" system has been extended :

    • The boot2docker FaQ says that you can provide a custom script, named bootlocal.sh to execute things at the end of the boot.
    • We customize in order to run that script from the /vagrant share when mounted, at the end of the boot.
    • So : just place a "bootlocal.sh" script alongside your Vagrantfile to customize what's inside your b2d VM.
  • If you use the VM as a remote Docker daemon in a private networked docker server you need to add in your bootlocal.sh : (Thanks to @Freyskeyd)

# Regenerate certs for the newly created Iprivate network IP
sudo /etc/init.d/docker restart
# Copy tls certs to the vagrant share to allow host to use it
sudo cp -r /var/lib/boot2docker/tls /vagrant/

Next, you need to configure your Docker environment :

  • Export cert path: export DOCKER_CERT_PATH=<Absolute path to your vagrant share>/tls
  • Export Docker host path : export DOCKER_HOST=tcp://192.168.10.10:2376 (You can also use localhost if the NAT is OK)

Building the Box

If you want to recreate the box, rather than using the binary, then you can use the scripts and Packer template within this repository to do so in seconds.

To build the box, first install the following prerequisites:

Then follow the steps:

$ make
...

boot2docker-vagrant-box's People

Contributors

dduportal avatar dlitz avatar felixbuenemann avatar fnichol avatar ingoclaro avatar jfoy avatar laurent-sarrazin avatar legal90 avatar lmakarov avatar lmars avatar luislavena avatar mitchellh avatar myatagaw avatar phpguru avatar refractalize avatar sennerholm avatar shawnbutts avatar simongiraud avatar simonista avatar spheromak avatar tfduesing avatar wjordan avatar wojtekmach avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.