Commit graph

309 commits

Author SHA1 Message Date
Brian Cain
4612619dc4
Fixup docker config update 2018-09-19 10:52:59 -07:00
Oleksiy Protas
166fe374b6
More explicit logging and 'dockerfile' option support 2018-09-19 10:25:37 -07:00
Oleksiy Protas
cbc69f5158
Build from git operation for docker 2018-09-19 10:24:09 -07:00
Oleksiy Protas
de6a1794c7
Config, validation and test 2018-09-19 10:24:09 -07:00
Oleksiy Protas
8d1b5fc1c9
Docu changes for building Docker images from git 2018-09-19 10:24:05 -07:00
Brian Cain
c2cff0dc07
Merge pull request #10100 from briancain/DOCKER-TOOLBOX
Convert windows paths for volume mounts on docker driver
2018-08-17 15:08:59 -07:00
Brian Cain
5d2d784ae7
(#9085) - Add test for converting windows paths
This commit adds a test for checking that a windows path for mounting a
volume in a container is properly converted into something that's
usable.
2018-08-08 10:30:04 -07:00
Matthew Olenik
428eb3ed93
Support Docker volume consistency for synced folders
Adds the `docker_consistency` option, which sets the Docker volume
consistency level. This can be used to greatly improved synced folder
performance, especially on macOS.

See for details: moby/moby#31047
2018-07-27 15:16:39 -07:00
Brian Cain
79e535a7ee
(#9622) Use SafeExec for docker-exec
This commit uses the internal helper SafeExec rather than using the
Kernel class directly. It also adds a test to ensure that if the `-t`
option is used, it will call SafeExec.
2018-05-02 14:23:50 -07:00
Isaac Freeman
de71626922 docker: use Kernel.system for docker-exec when -t is given 2018-04-18 17:50:47 -04:00
Josh Soref
1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
mihab
03178bbe04 Fixes #9085: Cannot up a machine with Docker Toolbox and Git Bash 2018-03-01 21:38:39 +01:00
Dimitrios Kouzis-Loukas
51716c5ef0 fix for issue 8608 2017-08-27 23:56:47 -04:00
Chris Roberts
f660c19084 Error when compose and force_host_vm are enabled together 2017-08-22 11:36:26 -07:00
Chris Roberts
1c763cf5e6 Expand relative volume paths for compose on current cwd 2017-08-21 13:26:19 -07:00
Chris Roberts
3b4901a5b5 Split compose links if string values 2017-07-31 14:23:50 -07:00
Dimitrios Kouzis-Loukas
34d8ffb9b2 Fixing vagrant ssh issue 8705
Fixing vagrant issue https://github.com/mitchellh/vagrant/issues/8705
2017-06-21 10:23:34 -04:00
Harry Weppner
250e74cb79 fix check for docker-compose 2017-06-08 11:09:41 -07:00
Chris Roberts
27ca3ef831 Convert Windows paths in volumes if detected 2017-05-12 15:11:10 -07:00
Chris Roberts
36ecd40c52 Support optional detach and pass blocks through to execution. 2017-05-12 15:09:30 -07:00
Chris Roberts
6096bb299b Only set image if option given. Do not apply when setting build options. 2017-05-12 15:09:30 -07:00
Chris Roberts
42c9042221 Deep merge configuration settings and set any extra options 2017-05-12 15:09:30 -07:00
Chris Roberts
9242a69545 Allow direct set of composition and ensure basic types are used 2017-05-12 15:09:30 -07:00
Chris Roberts
4673bbb907 Properly define service build within composition. Full cleanup on destroy. 2017-05-12 15:09:30 -07:00
Chris Roberts
b333e5cd82 Fix argument construction when adding dockerfile path
Fixes #7914
2017-05-12 15:09:30 -07:00
Chris Roberts
d1c1c175a0 Support modifications of composition outside services 2017-05-12 15:09:30 -07:00
Chris Roberts
d4bfade19f Include documentation on accessor in docker provider configuration 2017-05-12 15:09:30 -07:00
Chris Roberts
deba93ce5c Add optional support for docker-compose
Adds configuration switch to enable using docker-compose
to create and manage docker containers.
2017-05-12 15:09:30 -07:00
Chris Roberts
5d83c03bfc Properly handle synced folders in docker provider on WSL 2017-05-12 14:05:12 -07:00
Chris Roberts
ffc6e3e282 Merge pull request #8566 from chrisroberts/fix/docker-ssh
Fall back to old style ssh info lookup in docker provider
2017-05-08 10:14:51 -07:00
Chris Roberts
88dfe18a3f Fall back to old style ssh info lookup in docker provider
If ssh information cannot be properly extracted from within
the NetworkSettings data, fallback to original ssh information
implementation

Fixes #8552
2017-05-05 14:02:05 -07:00
Chris Roberts
e5e0274ef5 Update hyperv and docker providers to raise exception on SSH when machine is not ready
This makes the behavior of the docker and hyperv provider consistent with the
virtualbox provider by raising an error on ssh actions if the machine is not
created or not running.

Fixes #8508
2017-05-05 14:01:12 -07:00
Chris Roberts
05b6cdab6c Do not force docker host VM on Darwin or Windows 2017-04-03 14:48:14 -07:00
Chris Roberts
74ad90d8e0 Merge pull request #7840 from pstengel/bugfix/7651
Do better at finding ssh_info for Docker
2017-04-03 14:41:50 -07:00
Chris Roberts
6f578590a9 Skip forwarded port if disabled in docker provider 2017-03-09 10:28:41 -08:00
Paul Stengel
d98c5b8c00 Do better at finding ssh_info for Docker 2017-01-05 17:41:39 -05:00
Theron Boerner
391c5be08e Remove --interactive flag from Docker command
See: GH-7597. Due to the childprocess gem setting STDIN to a pipe,
Docker will fail as it requires STDIN to be a TTY if run with
--interactive.
2016-10-05 14:38:20 -05:00
Seth Vargo
e270e7df27
provider/docker: Add -u flag to exec 2016-05-31 20:05:27 -04:00
Seth Vargo
cfac24779c
provider/docker: Separate -i and -t flags for exec 2016-05-31 20:05:27 -04:00
Seth Vargo
bf96b3348b
provider/docker: Add docker-exec command
This adds a new core command, `docker-exec`, which allows the user to
exec into an already-running container.

- Fixes #6566
- Fixes #5193
- Fixes #4904
- Fixes #4057
- Fixes #4179
- Fixes #4903
2016-05-31 20:05:26 -04:00
Seth Vargo
38f23fe001
providers/docker: Allow TCP and UDP ports on same number
This commit changes the way ports are aggregated in the Docker provider.
Previously ports were aggregated by their "number", but that is not a
truly unique representation. Instead, the protocol is now taken into
account when generating the port map.

Fixes GH-5527
2016-05-30 17:23:44 -04:00
Ray Ruvinskiy
e42f346b1d
Make start action run provisioners if VM is running
Previously, there was no one gesture that would start a VM if it was not
running and run the appropriate provisioners regardless of its original
state. `vagrant up` did nothing if the VM was running, while
`vagrant provision` did nothing if the VM was not running.

Change the semantics of `vagrant up`, via the start actions of the providers,
to go through the provisioning logic even if the VM is already running.
The semantics of `run: "once"` vs `run: "always"` are respected.

Tested with the VirtualBox provider but not the others.

Resolves #4421
2016-05-27 19:00:33 -04:00
Seth Vargo
8c11b537ba
Allow Mac/Windows users to use Docker native 2016-05-27 17:36:07 -04:00
till
647bd6114c Change: disable the linux switch (Docker for Mac/Windows, etc.) 2016-05-08 21:35:12 +02:00
Seth Vargo
825bd6d5ef Run provisioner cleanup tasks before destroying the VM 2015-11-19 11:14:31 -08:00
Mitchell Hashimoto
bac5d039db providers/docker: pull setting, default false [GH-5932] 2015-07-15 11:08:01 -07:00
Mitchell Hashimoto
f1618f5ec8 providers/docker: don't remove image on reload for build cache 2015-07-09 14:23:26 -06:00
Adrian Guenter
9bdefb5c59 Don't destroy built Docker image on reload 2015-07-09 16:15:56 -04:00
Mitchell Hashimoto
9dd87b289e providers/docker: validate config after HandleBox [GH-5667] 2015-07-08 17:45:32 -06:00
Mitchell Hashimoto
be21604d45 providers/docker: style on custom Dockerfile 2015-07-08 16:07:57 -06:00
Mitchell Hashimoto
8d725c1f27 Merge pull request #5482 from duro/support-named-dockerfile
Support for Docker 1.5.0 named Dockerfile
2015-07-08 16:06:13 -06:00
Mitchell Hashimoto
0b6938d8ab core: don't prepare folders in disable ode 2015-07-08 15:43:42 -06:00
Mitchell Hashimoto
1c203405d2 providers/docker: fix crash if host VM file can't be foundJ:wq
gs
2015-07-08 12:31:24 -06:00
Mitchell Hashimoto
606a8fdde2 providers/docker: validate create args is list [GH-4850] 2015-07-08 10:25:32 -06:00
Mitchell Hashimoto
855aa66ad9 providers/docker: better error on suspend 2015-07-08 10:18:43 -06:00
Mitchell Hashimoto
dbf0af2e3f providers/docker: don't pull if image is built 2015-07-08 10:10:43 -06:00
Mitchell Hashimoto
c2cae80de5 providers/dock: pull image prior to starting 2015-07-08 10:09:15 -06:00
Mitchell Hashimoto
72b3ccd64f providers/docker: use new b2d box 2015-07-07 16:06:04 -06:00
Nathan
a6f300f3e9 Implement download method
Use the same method as upload, in a different order
2015-04-28 15:35:39 -05:00
Adam Duro
be81f09a60 Supporting a named Dockerfile for Docker 1.5.0 2015-03-13 17:30:42 -07:00
cubetto
2e659bf12c Update host_machine_build_dir.rb 2015-02-07 20:33:55 -03:00
Dan Carley
7529b66ea2 Disable insert_key for boot2docker host
Vagrant >1.7 is unable to login to the default boot2docker host if it has
been halted and brought back up again.

This is because the insecure SSH keypair is replaced but boot2docker doesn't
persist filesystem changes between reboots. So when next brought up Vagrant
tries to use the new keypair which is no longer valid and subsequently isn't
able to login.

Prevent this from happening by disabling the `ssh.insert_key` option on
versions where it is available.
2015-01-08 11:23:37 +00:00
Seth Vargo
d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Gilles Cornu
40a22ff99a providers/docker: fix support of agent forwarding 2014-12-07 11:02:50 +01:00
Mitchell Hashimoto
b656bf4ae5 providers/docker: build output [GH-3739] 2014-10-23 15:03:09 -07:00
Mitchell Hashimoto
f122ed756c Merge pull request #4571 from jperville/docker-provider-allow-multiple-links-to-same-backend
providers/docker: allow multiple links to same backend (different aliases)
2014-10-23 09:45:14 -07:00
Mitchell Hashimoto
1e6259dd00 providers/docker: set preparing set to avoid data dir clear [GH-3873] 2014-10-22 20:52:08 -07:00
Mitchell Hashimoto
0e29dd5668 commands/rsync: handle proxy machines [GH-4066] 2014-10-22 16:17:39 -07:00
Mitchell Hashimoto
296d0639cc providers/docker: support auth [GH-4042] 2014-10-22 13:12:31 -07:00
Mitchell Hashimoto
cff57c8d01 core: trigger machine_id_changed for reload [GH-3963] 2014-10-22 12:07:49 -07:00
Mitchell Hashimoto
1ee46d3c95 providers/docker: check proper state for docker-logs [GH-3990] 2014-10-22 11:20:00 -07:00
Mitchell Hashimoto
9c23e4d9cb providers/docker: expand vagrant_vagrantfile [GH-4000] 2014-10-22 11:02:26 -07:00
Mitchell Hashimoto
59fe62ec11 providers/docker: public_address reports host machine addr [GH-4342] 2014-10-22 10:37:32 -07:00
Mitchell Hashimoto
57a1269e35 providers/docker: read the container ID properly 2014-10-22 09:33:57 -07:00
Mitchell Hashimoto
9d4ab18f42 providers/docker: stop_timeout [GH-4504] 2014-10-21 17:50:45 -07:00
Mitchell Hashimoto
e749eaa039 providers/docker: more robustly detect built image [GH-4598] 2014-10-21 17:44:48 -07:00
Mitchell Hashimoto
fb1a825c0d providers/docker: host IP and protocol is respected [GH-4505] 2014-10-21 17:17:34 -07:00
Mitchell Hashimoto
5228437b30 providers/docker: nicer error if package is called [GH-4595] 2014-10-21 17:04:46 -07:00
Mitchell Hashimoto
7f432422e1 providers/docker: properly copy create_args in config [GH-4526] 2014-10-21 16:39:26 -07:00
Julien Pervillé
97341c3234 providers/docker: allow multiple links to same backend (different aliases). 2014-09-29 18:46:01 +02:00
Mitchell Hashimoto
9ff18fb1b7 providers/docker: unique name with docker-run 2014-08-30 22:29:46 -07:00
Ray Clanan
f1e730e9a1 Unset container name if docker_run is called. Fixes #4294 2014-08-29 23:29:58 -04:00
Mitchell Hashimoto
b4345968a5 providers/docker: SSH extra args go to Docker container [GH-4378] 2014-08-29 11:11:53 -07:00
Leo Simons
fec14cf04c Use -f argument to rm to force-remove files.
When using pty=true, removing files using sudo may request confirmation,
which will hang the connection.

Similarly, sometimes assumptions about file existence may be wrong and
in those cases it seems better to continue on as long as the file does
not exist, so -f makes sense there, too.
2014-08-29 10:51:31 +02:00
Paris Holley
802d17a248 remove vm by default when using docker run 2014-08-09 12:03:35 -07:00
Mitchell Hashimoto
1428ab0404 providers/docker: single port works [GH-3991] 2014-08-06 15:34:41 -07:00
Mitchell Hashimoto
6369d870d8 providers/docker: support for UDP forwarded ports [GH-3886] 2014-05-23 10:16:16 -07:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
6c5251f499 providers/docker: verify host VM SSH is ready [GH-3838] 2014-05-20 20:41:48 -07:00
Mitchell Hashimoto
4e7a25f6de Merge pull request #3807 from mitchellh/fix-docker-ssh-wo-host-vm
providers/docker: Fix SSH access to container when no Host VM is in use
2014-05-20 20:32:21 -07:00
Mitchell Hashimoto
5bd0a99b31 providers/docker: don't port map SSH if no has_ssh [GH-3857] 2014-05-20 19:47:21 -07:00
Mitchell Hashimoto
efd67e6c9d providers/docker: retry container ssh command [GH-3763] 2014-05-17 13:14:07 -07:00
Mitchell Hashimoto
f2b4f5411a providers/docker: don't use graceful shutdown [GH-3798] 2014-05-17 12:16:32 -07:00
Fabio Rehm
7eecf31faa providers/docker: Fix SSH access to container when no Host VM is in use [GH-3799] 2014-05-15 20:14:10 -03:00
Mitchell Hashimoto
ca6e2393bd core: providers can choose to not be defaultable [GH-3742] 2014-05-09 16:02:09 -07:00
Mitchell Hashimoto
745bdf6766 providers/docker: ability to specify build dir synced folder opts [GH-3727] 2014-05-08 18:46:03 -07:00
Mitchell Hashimoto
aee71a093b providers/docker: forward ports properly 2014-05-08 13:37:55 -07:00
Gosha Arinich
faba9bdae9 Revert "providers/docker: Container links are an array, not a hash"
This reverts commit b68cb6d7b4.
2014-05-08 21:10:37 +03:00
Mitchell Hashimoto
9a8a0499c7 providers/docker: don't use HGFS on VMware fusion [GH-3687] 2014-05-08 10:06:06 -07:00
Mitchell Hashimoto
030c1ee481 providers/docker: build_args [GH-3684] 2014-05-07 18:41:24 -07:00
Mitchell Hashimoto
b2f9e86135 providers/docker: make sure command isn't scoped 2014-05-07 15:12:30 -07:00
Mitchell Hashimoto
61caaa00c6 commands/docker-run: --help works [GH-3698] 2014-05-07 15:11:57 -07:00
Mitchell Hashimoto
a00d2481f5 providers/docker: put sync folders in var lib docker [GH-3680] 2014-05-07 15:09:53 -07:00
Mitchell Hashimoto
cc75eb188f providers/docker: support custom shell properly [GH-3697] 2014-05-07 15:00:51 -07:00
Fabio Rehm
b68cb6d7b4 providers/docker: Container links are an array, not a hash 2014-05-07 12:12:16 -03:00
Mitchell Hashimoto
ca428388d8 providers/docker: can set default provider to docker [GH-3662] 2014-05-06 21:49:49 -07:00
Michael Louis Thaler
9dcc53673a Fix error reporting bug
There's no "command" variable; it should be "cmd". This bug causes it to print an unhelpful exception if the Docker command fails.
2014-05-06 17:46:09 -04:00
Mitchell Hashimoto
337e51c2a6 providers/docker: don't reload if not created 2014-05-05 22:06:22 -07:00
Mitchell Hashimoto
38d1f0c0aa providers/docker: smarter destroy, does not require host machine 2014-05-05 22:02:13 -07:00
Mitchell Hashimoto
a34ee404d8 providers/*: use special NOT_CREATED_ID if not created 2014-05-05 21:52:28 -07:00
Mitchell Hashimoto
ff2f035f27 providers/docker: less hack way to clear ID if not created 2014-05-05 21:37:02 -07:00
Mitchell Hashimoto
b26ecb0150 providers/docker: smarter about setting ID to nil for machine 2014-05-05 21:35:08 -07:00
Mitchell Hashimoto
d7a9bcda47 providers/docker: vagrant_machine setting works proprely 2014-05-05 21:13:15 -07:00
Mitchell Hashimoto
f475df0987 providers/virtualbox: don't do transient by default 2014-05-05 15:44:45 -07:00
Mitchell Hashimoto
744c9c9663 providers/docker: choose proper provider for host VM 2014-05-01 10:22:43 -07:00
Mitchell Hashimoto
76e29b912f providers/docker: lower priority
We do this mostly because Docker is the only provider that using it
requires some amount of Docker-specific knowledge. VirtualBox, VMware,
etc. kind of "just work". It is not the likely case that someone does
a `vagrant up` and expects Docker, at this point.
2014-05-01 09:51:50 -07:00
Mitchell Hashimoto
df399d8610 providers/docker: use the proper class 2014-04-30 09:22:02 -07:00
Mitchell Hashimoto
92df8cf6ae Handle a lot of TODOs 2014-04-29 16:50:58 -07:00
Mitchell Hashimoto
19af4b70e6 providers/docker: with a pty, single target the docker-run cmd 2014-04-29 16:31:43 -07:00
Mitchell Hashimoto
0bb523ebb0 providers/docker: use ssh_run if asking for stdin on execute 2014-04-29 16:27:22 -07:00
Mitchell Hashimoto
e90e45a8fb providers/docker: pty flag, not functional yet 2014-04-29 15:51:32 -07:00
Mitchell Hashimoto
ca5651a0b1 providers/docker: clearer options on docker-logs 2014-04-29 14:28:10 -07:00
Mitchell Hashimoto
013fc729a5 providers/docker: raise better error for local executor 2014-04-29 14:16:24 -07:00
Mitchell Hashimoto
d7343c5b56 providers/docker: expand path to share relative to docker env 2014-04-28 11:08:58 -07:00
Mitchell Hashimoto
d7ecd99e2e providers/docker: be more lenient about deleting built image 2014-04-28 09:36:55 -07:00
Mitchell Hashimoto
8ed5351dd1 providers/docker: destroy built image on up 2014-04-27 19:36:02 -07:00
Mitchell Hashimoto
27cd8886b3 providers/docker: cleaner reload 2014-04-27 19:27:11 -07:00
Mitchell Hashimoto
12d3e06f69 providers/docker: can docker-run non-existent containers 2014-04-27 19:22:14 -07:00
Mitchell Hashimoto
a2b4f31916 providers/docker: don't show cmd if one is not specified 2014-04-27 19:06:39 -07:00
Mitchell Hashimoto
685bdbf1f0 whitespace 2014-04-27 18:58:57 -07:00
Mitchell Hashimoto
c818a14072 providers/docker: expose ports 2014-04-27 18:37:25 -07:00
Mitchell Hashimoto
ff9de3586a providers/docker: run_command doesn't need to actual setup host machine 2014-04-27 18:28:11 -07:00
Mitchell Hashimoto
a8822e84d2 providers/docker: fix some extranneous newlines in streamed output 2014-04-27 18:26:12 -07:00
Mitchell Hashimoto
f1e1617cfd providers/docker: stream data for run 2014-04-27 18:23:31 -07:00
Mitchell Hashimoto
abf7c0526b providers/docker: docker-run command starting points 2014-04-27 18:10:41 -07:00
Mitchell Hashimoto
7cbef9b3d9 providers/docker: doesn't support NFS if b2d [GH-3510] 2014-04-21 20:38:10 -07:00
Mitchell Hashimoto
568185c3e9 providers/docker: always copy the host VM Vagrantfile 2014-04-21 13:56:31 -07:00
Mitchell Hashimoto
2e8f837f9b providers/docker: fix exception typo 2014-04-21 13:56:29 -07:00
Mitchell Hashimoto
89b6336d21 providers/docker: retry sync_folders action 2014-04-21 13:56:28 -07:00
Mitchell Hashimoto
e38ae9b5c6 providers/docker: don't guard for image on create, since can come from build 2014-04-21 13:56:27 -07:00
Mitchell Hashimoto
1c3ee6ffa3 providers/docker: rebuild image if it doesn't exist 2014-04-21 13:56:26 -07:00
Mitchell Hashimoto
d837086572 providers/docker: get rid of mutex around Docker access, should be safe 2014-04-21 13:56:25 -07:00
Mitchell Hashimoto
aa13a43c69 providers/docker: its okay if no image file on destroy 2014-04-21 13:56:23 -07:00
Mitchell Hashimoto
8171471628 providers/docker: make merge logic a bit more sensible 2014-04-21 13:56:13 -07:00
Mitchell Hashimoto
8a76c2bc76 providers/docker: can force a host VM optionally 2014-04-21 13:56:08 -07:00
Mitchell Hashimoto
79793ab130 providers/docker: config validation and specs 2014-04-21 13:56:07 -07:00
Mitchell Hashimoto
0094a58227 providers/docker: when building from Dockerfile, show image ID 2014-04-21 13:56:06 -07:00
Mitchell Hashimoto
052ee624bb providers/docker: forgot a file 2014-04-21 13:56:05 -07:00
Mitchell Hashimoto
f78f72920c providers/docker: flatten stack so it runs at one point 2014-04-21 13:56:04 -07:00
Mitchell Hashimoto
067c1ca348 providers/docker: reuse action stacks where possible 2014-04-21 13:56:02 -07:00