Commit graph

27 commits

Author SHA1 Message Date
Daniel Portella
1801efaf99 provider/docker: Fixes for docker_container host object and documentation (#9367)
* Updated docker container documentation

Feedback from ticket #9350 indicated that documentation was out of date

renamed `hosts_entry` to `host`
added correct type information to *Extra Hosts* section.

Refs: 9350

* Fixes for docker_container host object

Feedback from ticket #9350 updated codebase so it reflects the requirements from docker in regards to `host` which is `Required` and not optional.
It now accurately reflects the docker requirements and the terraform documentation.

Test results

> Bear in mind the failure it is because my laptop doesnt support memory swap. So this test will always fail.

Changing the Schema from `optional` to `required` made no difference to the tests.

make testacc TEST=./builtin/providers/docker/
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/14 15:04:40 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/docker/ -v  -timeout 120m
=== RUN   TestAccDockerRegistryImage_basic
--- PASS: TestAccDockerRegistryImage_basic (4.57s)
=== RUN   TestAccDockerRegistryImage_private
--- PASS: TestAccDockerRegistryImage_private (6.22s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDockerContainer_basic
--- PASS: TestAccDockerContainer_basic (7.16s)
=== RUN   TestAccDockerContainer_volume
--- PASS: TestAccDockerContainer_volume (7.37s)
=== RUN   TestAccDockerContainer_customized
--- FAIL: TestAccDockerContainer_customized (18.99s)
	testing.go:265: Step 0 error: Check failed: Check 2/2 error: Container has wrong memory swap setting: -1
	Please check that you machine supports memory swap (you can do that by running 'docker info' command).
=== RUN   TestAccDockerImage_basic
--- PASS: TestAccDockerImage_basic (2.58s)
=== RUN   TestAccDockerImage_private
--- PASS: TestAccDockerImage_private (2.70s)
=== RUN   TestAccDockerImage_destroy
--- PASS: TestAccDockerImage_destroy (30.00s)
=== RUN   TestAccDockerImage_data
--- PASS: TestAccDockerImage_data (5.93s)
=== RUN   TestAccDockerNetwork_basic
--- PASS: TestAccDockerNetwork_basic (0.24s)
=== RUN   TestAccDockerVolume_basic
--- PASS: TestAccDockerVolume_basic (0.05s)
FAIL
exit status 1
FAIL	github.com/hashicorp/terraform/builtin/providers/docker	85.816s
Makefile:47: recipe for target 'testacc' failed
make: *** [testacc] Error 1

Refs: 9350
2016-10-27 10:54:05 +01:00
JB Arsenault
439a19426c Add destroy_grace_seconds option to stop container before delete (#7513) 2016-07-11 16:03:02 +01:00
Daniel Portella
efcec57608 provider/docker: Docker DNS Setting Enhancements (#7392)
* fixed go vet issues on aws provider in  master

* added support for dns, dns options and dns search for docker container.

On docker container resource you can specify dns_opts nad dns_search
which maps directly to docker --dns_opt and --dns_search parameters.
Allowing users to setup the embedded dns settings for their containers.

* fixed the asserts for the new features in tests.

fixed tests around DNS, DNS_OPTS and DNS_SEARCH
2016-06-29 13:38:46 +01:00
VERDOÏA Laurent
5cdb31fec1 provider/docker: #5298 Add support for docker run --user option 2016-04-04 21:43:59 -05:00
Verdoïa Laurent
193c75b164 provider/docker: #2417 Add support for restart policy unless-stopped 2016-02-26 12:38:31 +09:00
Trevor Pounds
5e0b6e3750 Use built-in schema.HashString. 2016-02-07 16:29:34 -08:00
James Nugent
50d8d5773f provider/docker: Mount named volumes in containers
This adds support for specifying named volumes for mounting in a
`docker_container` resource.
2016-01-15 21:59:33 +00:00
James Nugent
75e1fee5fa provider/docker: Tweak and test host_entry
This adds acceptance tests for specifying extra hosts on Docker
containers. It also renames the repeating block from `hosts` to `host`,
which reads more naturally in the schema when multiple instances of the
block are declared.
2016-01-15 03:02:20 +00:00
James Nugent
ed0a250129 Merge branch 'docker-extra-hosts' of https://github.com/paulbellamy/terraform into paulbellamy-docker-extra-hosts 2016-01-14 15:48:51 +00:00
James Nugent
f770ba6120 Merge branch 'docker_network' of https://github.com/ColinHebert/terraform into ColinHebert-docker_network 2016-01-14 07:01:03 +00:00
Colin Hebert
bca87ec0ff Add Elem and Set to the network set 2016-01-05 03:46:24 +01:00
Colin Hebert
99f83853f7 Add the networks entry 2016-01-04 20:58:54 +01:00
Colin Hebert
a44b873992 Add network_mode support to docker 2016-01-01 09:57:21 +01:00
stack72
3f3e9fab7d Fixing yet more gofmt errors with imports 2015-12-21 09:54:24 +00:00
Paul Bellamy
1c8e4c81e4 provider/docker: Inline ports and volumes schemas for consistency 2015-12-03 10:51:59 +00:00
Paul Bellamy
7bfa5f90b9 provider/docker: Add hosts parameter for containers 2015-12-03 10:32:41 +00:00
ryane
5a5f5ff988 docker: improve validation of runtime constraints 2015-11-09 19:36:23 -05:00
ryane
38b1e1ce26 support for log driver + config in docker container 2015-11-04 15:52:16 -05:00
ryane
8f9b151811 add label support to docker container resource 2015-11-04 15:52:15 -05:00
ryane
38eec5fbc7 add basic runtime constraints to docker_container 2015-11-04 15:52:15 -05:00
ryane
311b164d56 restart policy support for docker_container 2015-11-04 15:52:15 -05:00
ryane
4b257e6b2b entrypoint support for docker_container resource 2015-11-04 15:52:15 -05:00
Julian Schneider
b440ebc492 Add privileged option to docker container resource 2015-06-04 13:05:52 +02:00
Paul Hinze
d9b3a99ef6 provider/docker: fmt on container resource 2015-04-20 14:18:46 -05:00
Stephan Epping
8cbb3adce4 Add docker container network settings to output attribute 2015-04-20 12:41:35 -05:00
Nick Downs
2c7fb5fcc7 Added Docker links support to the docker_container resource. 2015-04-16 12:42:21 -07:00
Jeff Mitchell
77e1e6067e Initial commit. This adds the initial bits of a Docker provider.
Docker's API is huge and only a small subset is currently implemented,
but this is expected to grow over time. Currently it's enough to
satisfy the use cases of probably 95% of Docker users.

I'm preparing this initial pull request as a preview step for feedback.
My ideal scenario would be to develop this within a branch in the main
repository; the more eyes and testing and pitching in on the code, the
better (this would avoid a merge request-to-the-merge-request scenario,
as I figure this will be built up over the longer term, even before
a merge into master).

Unit tests do not exist yet. Right now I've just been focused on getting
initial functionality ported over. I've been testing each option
extensively via the Docker inspect capabilities.

This code (C)2014-2015 Akamai Technologies, Inc. <opensource@akamai.com>
2015-03-10 15:38:52 +00:00