A template proposal to integrate in your project and work with vagrant-boot2docker-box.
This template aims to contain minimal files and the remaining part is located in a git repo like vagrant-boot2docker-extension.
The following software shall be installed on your computer:
The following documentation is not exhaustive be seems to represent the topics you should be aware of:
- Docker official documentation
- Vagrant official documentation and especially
- Vagrant client
- All integrated
README.mdin this project (and related projects) folders
Following docker stable versions
This project aims to follow mainly docker stable releases. Meaning that each docker release, especially test ones may not be published here.
- Get the last version in your project or where your want (clone directly or get the zip on github)
- Go with a shell in your root directory and type
vagrant upto start your boot2docker workspace
- Go inside your boot2docker environment with
- Run docker-toolbox with
- With or without docker-toolbox, your files are located in
dk tbbring you directly in this directory
Outside the box
vagrant upto start your boot2docker VM (the first time it will download automatically the VM file).
vagrant sshto connect in your boot2docker
exitin your boot2docker to get out of your environment
vagrant haltto stop your boot2docker (but you can do this once a day or a week for example !)
vagrant destroy --forceto delete your boot2docker (usefull if you want to redo all from scratch)
vagrant destroy --force && vagrant box updateto update your boot2docker (for example to get the new version of docker !), be carefull all your containers will be deleted
vagrant reloadrestart your boot2docker VM
vagrant up --provisionor
vagrant reload --provisionto redo a boot2docker VM customization (called provisioning)
Inside the box
B2D_BOXname of the vagrant box on the vagrant cloud. Default is
AlbanMontaigu/boot2dockerfor vagrant-boot2docker-box. Change it a your own risk.
B2D_VERSIONvagrant box version. With the default box, will stick to docker versions.
B2D_CPUnumber of CPU for the VM.
B2D_MEMORYmemory of the VM.
B2D_EXTENSION_REPOgit URL repo for this box extension. Default is boot2docker-vagrant-extension. Change it with your version if you want.
B2D_EXTENSION_VERSIONversion of the extension, will sti to docker versions.
OFFto activate or not the docker-toolbox-extension. This will add extended features to the docker-toolbox.
OFFto activate or not the docker-transparent-proxy. This will run a transparent proxy for your docker containers with dynamic proxy switch depending your urls / ip.
Proxy considerations (DK_PROXYD_STATUS)
This daemon aims to start transparent proxy for your containers only. When you set
DK_PROXYD_STATUS="ON" you will activate a specific proxy daemon that is run inside a docker container.
Important note: Your boot2docker environment need to have
http_proxy env var set to run (see vagrant-proxyconf). Leave
http_proxy to blank if you want
proxyd to try to auto detect your proxy (with wpad mechanism).
Please be aware that you can set custom
proxy.pac files in this environment if you want. Check boot2docker-vagrant-extension in
daemons folder for more information.
How to upgrade the box ?
In most cases, you dont need to change the templates files. However, read carefully
CHANGELOG.md in the boot2docker-vagrant-template project to know if it is requested.
Then do the following:
B2D_VERSIONwith the new one in your
- Outside boot2docker and inside the your boot2docker project folder:
vagrant destroy --force
For small updates without vagrant-boot2docker-box update, with a running boot2docker and outside it just do a
vagrant provision and then
vagrant ssh to enjoy your environment.
How and where box features are managed ?
Box extension strategy
Any modification provided by a new version or customization shall be located in extension system like boot2docker-vagrant-extension. It means that during boot, the extension git repo will be cloned from the extension URL.
So you will need a working internet connection for that. This can be annoying but this is the price to pay to reduce impact on your project.
You can provide your own custom extension like boot2docker-vagrant-extension. For instance fork it and change it as you want as long as you respect the proposed layout.
Of course don't forget to change the extension git URL is set in the
B2D_EXTENSION_REPO parameter of the root
Where are the box extension files ?
Extension files are located in your boot2docker environment, more precisely in the boot2docker system files and not in your project files.
There is a special directory where the extension is downloaded:
docker-toolbox containerMore extension with docker in
Features added in the current boot2docker template together with its extension aims to be minimal.
Major part of the features are located in a docker-toolbox docker image which is started as a container with a
dk tb command inside your boot2docker environment (after a
This way allow to have most of your features inside a container that you can run everywhere (and not especially in boot2docker) thanks to docker.