This example shows how to deploy configuration consisting of a single container based on custom image which automatically built from provided Dockerfile.
- Fabricio 0.3.17 or greater
- Vagrant
- One from the list of Vagrant supported providers (this example was tested with VirtualBox)
- Docker for Linux/Mac/Windows
- Docker registry which runs locally on 5000 port, this can be reached out by executing following docker command:
docker run --name registry --publish 5000:5000 --detach registry:2
Run vagrant up
and wait until VM will be created.
- Dockerfile, used for building image
- fabfile.py, Fabricio configuration
- README.md, this file
- Vagrantfile, Vagrant config
fab --list
fab my_nginx
At first, this will initiate creation of a new Virtual Machine (if not created yet) using Vagrant
configuration. Then deploy itself will start.
Any Fabricio command can be executed in parallel mode. This mode provides advantages when you have more then one host to deploy to. Use --parallel
option if you want to run command on all hosts simultaneously:
fab --parallel my_nginx
See also "Hello, World" Customization section.
You can provide custom folder with Dockerfile
by passing build_path
parameter:
build_path='path_to_folder_with_dockerfile'
- If you see warnings in
Vagrant
logs about Guest Extensions version is not match VirtualBox version try to installvagrant-vbguest
plugin that automatically installs Guest Extensions of version which corresponds to your version of VirtualBox:vagrant plugin install vagrant-vbguest
- Windows users may fall into trouble with
VirtualBox
andHyper-V
, the latter is used by "native" Docker for Windows. Try to disable Hyper-V and use Docker Toolbox instead in such case