Commit Graph

54 Commits

Author SHA1 Message Date
Alex Dadgar
70f4fc5b15 Change two helper functions to be methods 2015-10-15 17:47:14 -07:00
Alex Dadgar
87ae6c6be6 Remove debug lines 2015-10-15 17:30:40 -07:00
Alex Dadgar
5bf2ad0261 Docker alloc dir tests and test fixes 2015-10-15 16:59:08 -07:00
Alex Dadgar
db88c38bc7 Bind alloc dir and task local dir to docker containers and parse args correctly 2015-10-15 16:40:07 -07:00
Abhishek Chanda
4275f27f9f Run gofmt on the docker driver 2015-10-13 23:21:16 +00:00
Abhishek Chanda
b26c11b3b4 Do not default to a network mode
Makes the driver error out when a wrong or un-supported
network_mode is used
2015-10-13 10:57:21 -07:00
Alex Dadgar
5a0551aed9 Change Docker/Rkt to set driver to 1 not true for consistency 2015-10-12 13:15:37 -07:00
Chris Bednarski
6e43a2ba33 Use DefaultDockerHost from fsouza upstream 2015-10-08 12:35:19 -07:00
Chris Bednarski
8b0c18db5f Remove panic -- client is nil when there is an error 2015-10-06 19:09:59 -07:00
Chris Bednarski
d7023f8f71 Merge branch 'master' into b-docker-port 2015-10-06 17:54:32 -07:00
Chris Bednarski
f3b5d553ad Support boot2docker or VM for dev/test 2015-10-06 17:53:05 -07:00
Chris Bednarski
2801e7d1e1 Fingerprint test should now behave correctly when the executor is not installed; fix some go vet issues 2015-10-06 16:33:02 -07:00
Chris Bednarski
127dc127b2 Use docker.NewClient; move dockerClient before it's used 2015-10-06 16:26:31 -07:00
Chris Bednarski
7017276df6 Merge branch 'docker-use-environment' of https://github.com/carlosdp/nomad into b-docker-port 2015-10-06 15:36:06 -07:00
Carlos Diaz-Padron
078a025725 Use environment to connect to Docker by default
Uses the environment definition for docker by default. Docker will
default to the unix/tcp socket if the environment is not set.
2015-10-04 12:59:54 -07:00
Alex Dadgar
5294330cf7 go-fmt 2015-10-02 10:54:04 -07:00
Abhishek Chanda
0ef12a5ef7 Make sure createHostConfig is called only once
The second call discards any mods to port binding or
network type

Fixes #185 and #196
2015-10-02 10:43:37 -07:00
Abhishek Chanda
ee2cd3bed0 Enable setting networking mode for docker
This patch enables setting networking mode for the docker
driver. This does not handle the `container` mode.
Closes #175
2015-10-01 18:52:41 -07:00
Armon Dadgar
d054a06dc4 docker: check for missing unix socket 2015-09-27 17:49:58 -07:00
Alex Dadgar
75f93ce9fb Pull task environments into their own type to be reusable across drivers and executors 2015-09-27 17:37:24 -07:00
Alex Dadgar
c555c70eeb merge fixes 2015-09-27 17:37:24 -07:00
Chris Bednarski
bc3504a7d0 Correct implementation of config check for container and image cleanup; moved into Start and Open because handle does not have the config object 2015-09-27 13:59:38 -07:00
Chris Bednarski
24c5fc9cc5 Merge branch 'master' into f-docker-config-cleanup 2015-09-26 21:52:02 -07:00
Chris Bednarski
51bf0162d0 Add configuration option for whether Nomad will clean up containers and images when they are no longer used 2015-09-26 18:53:15 -07:00
Chris Bednarski
bb9fbf8f22 Add all containers when searching for images that are still in used, since the container using the image may be stopped 2015-09-26 18:51:36 -07:00
Chris Bednarski
b0c1b04264 Log an info when an image can't be removed because it's still in use 2015-09-26 00:34:57 -07:00
Chris Bednarski
30fd526766 Use env.Get, remove sha256 checks, and change from regexp to strconv to test for int 2015-09-25 23:55:01 -07:00
Chris Bednarski
5d4d044a6f Add docker 'command' to docs; cleanup some comments 2015-09-25 23:28:23 -07:00
Chris Bednarski
928fe86553 Replace docker version and docker ps with native calls; no more exec! 2015-09-25 23:13:40 -07:00
Chris Bednarski
6c5ddb3076 Docker kill now exits with an error, as expected 2015-09-25 22:43:19 -07:00
Chris Bednarski
784d0e9e15 Go native for docker API calls 2015-09-25 20:01:03 -07:00
Chris Bednarski
cf0440dbe3 Improve handling of tagged docker images
- Converted Start() to use docker native client throughout
- Better handling of latest vs. tagged images
    - We can now support multiple versions of an image
    - We will now not download a tag if we already have it
2015-09-25 18:22:10 -07:00
Chris Bednarski
59a1ed34fa Merge pull request #104 from hashicorp/f-docker-static-ports
Add static (reserved) ports for docker
2015-09-24 15:44:41 -07:00
Chris Bednarski
4dc1fb351b Get only one version of a docker container 2015-09-24 14:07:28 -07:00
Chris Bednarski
29020ab263 Rename containerConfigForTask to createContainer to mirror the docker api call; other helper functions will follow this convention too 2015-09-24 00:00:46 -07:00
Chris Bednarski
1d4d349e92 Rename containerConfig to hostConfig since there are two types of container configs 2015-09-23 23:57:04 -07:00
Chris Bednarski
e9b7287935 Added static / reserved port allocations to docker 2015-09-23 23:45:34 -07:00
Chris Bednarski
50d0a852eb Format as string instead of casting to string 2015-09-23 19:29:53 -07:00
Chris Bednarski
084e6f455d Support mapped ports and labelled ports for docker 2015-09-23 18:19:01 -07:00
Chris Bednarski
5449c8290b Add docker ports; change to uppercase examples and tests 2015-09-23 18:01:08 -07:00
Chris Bednarski
e47a244046 Added environment variables to docker 2015-09-22 23:12:24 -07:00
Chris Bednarski
db4e9c93bf Removed comment that's no longer relevant 2015-09-22 20:11:07 -07:00
Chris Bednarski
3c1bb50da3 Change error to err to be consistent with other usage 2015-09-11 10:26:33 -07:00
Chris Bednarski
3862b0adb4 Fix typos 2015-09-10 11:35:03 -07:00
Chris Bednarski
0e7ebb7447 Change panic to a more helpful message 2015-09-09 19:04:06 -07:00
Chris Bednarski
6445e14755 Merge branch 'f-driver-config' into f-docker-resource-constraints 2015-09-09 18:47:35 -07:00
Chris Bednarski
8d4d9645d8 Replace logging and config with DriverContext, which allows us to expand the dependency injection without changing the interface 2015-09-09 18:06:23 -07:00
Chris Bednarski
44f04313e2 Add logger to the dockerHandle created by Open() 2015-09-09 13:43:28 -07:00
Chris Bednarski
0f57a2c077 Cleanup based on PR feedback
- Add validation that Resources.MemoryMB and Resources.CPU have non-zero values
- Change log calls to use logger whenever possible
- Change log format to add colon after driver.docker
2015-09-09 13:35:10 -07:00
Chris Bednarski
92ca9c4679 Added preliminary resource constraints for docker; CPU and Memory 2015-09-09 01:08:31 -07:00