» Docker Configuration
One of the following settings is required when using the Docker provider:
(string) - The image to launch, specified by the image ID or a namesuch as
ubuntu:12.04
.git_repo
(string) - The URL of a git repository to build the image from.Supports pulling specific tags, branches and revision, consult thefor more information.
» Optional
General settings:
(array of strings) - Extra arguments to pass to
docker build
whenbuild_dir
is in use.cmd
(array of strings) - Custom command to run on the container.Example:["ls", "/app"]
.(boolean) - If true, Vagrant will use
docker-compose
tomanage the lifecycle and configuration of containers. This defaultsto false.compose_configuration
(Hash) - Configuration values used for populatingthedocker-compose.yml
file. The value of this Hash is directly mergedand written to thedocker-compose.yml
file allowing customization ofnon-services items like networks and volumes.(string) - Name of the Dockerfile in the build directory.This defaults to "Dockerfile"
env
(hash) - Environmental variables to expose into the container.(array of integers) - Ports to expose from the containerbut not to the host machine. Useful for links.
link
(method, string argument) - Link this container to anotherby name. The argument should be in the format of(name:alias)
.Example:docker.link("db:db")
. Note, if you are linking toanother container in the same Vagrantfile, make sure you callvagrant up
with the—no-parallel
flag.(boolean) - If true, then a host VM will be spun upeven if the computer running Vagrant supports Linux containers. Thisis useful to enforce a consistent environment to run Docker. This valuedefaults to "false" on Linux, Mac, and Windows hosts and defaults to "true"on other hosts. Users on other hosts who choose to use a different Dockerprovider or opt-in to the native Docker builds can explicitly set thisvalue to false to disable the behavior.
has_ssh
(boolean) - If true, then Vagrant will support SSH withthe container. This allowsvagrant ssh
to work, provisioners, etc.This defaults to false.(hash) - Synced folder options for the
build_dir
, since the build directory is synced using a synced folderif a host VM is in use.name
(string) - Name of the container. Note that this has to be uniqueacross all containers on the host VM. By default Vagrant will generatesome random name.(bool) - If true, the image will be pulled on every
up
andreload
. Defaults to false.remains_running
(boolean) - If true, Vagrant expects this containerto remain running and will make sure that it does for a certain amountof time. If false, then Vagrant expects that this container willautomatically stop at some point, and will not error if it sees it do that.(integer) - The amount of time to wait when stoppinga container before sending a SIGTERM to the process.
vagrant_machine
(string) - The name of the Vagrant machine in thevagrant_vagrantfile
to use as the host machine. This defaults to"default".(string) - Path to a Vagrantfile that containsthe
vagrant_machine
to use as the host VM if needed.volumes
(array of strings) - List of directories to mount asvolumes into the container. These directories must exist in thehost where Docker is running. If you want to sync folders from thehost Vagrant is running, just use synced folders.
Below, we have settings related to auth. If these are set, then Vagrantwill docker login
prior to starting containers, allowing you to pullimages from private repositories.
(string) - Email address for logging in.
username
(string) - Username for logging in.(string) - Password for logging in.