Commit graph

39 commits

Author SHA1 Message Date
Jake Champlin
e23185d484
Transfer docker provider 2017-06-06 11:50:32 -04:00
Januar
7446f70146 provider/docker network alias (#14710)
* Add Network Alias configuration with network options

* Handle case where there's no network option

* Handle use case where network option is not available

* Handle use case where network option is not available

* Network alias only on user defined network

* Update documentation for docker provider on network aliases

* Remove unused variable

* Update documentation

* add unit test for docker container network

* fix unit test for docker container network
2017-05-22 09:20:32 -04:00
Daniel Portella
ae63f9ce26 provider/docker: added support for linux capabilities (#12045)
* added support for linux capabilities

Refs #11623

Added capabilities block
Added tests for it
Added documentation for it.

My PC doesnt support memory swap so it errors there.

```
$ make testacc TEST=./builtin/providers/docker TESTARGS='-run=TestAccDockerContainer_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/17 14:57:08 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/docker -v -run=TestAccDockerContainer_ -timeout 120m
=== RUN   TestAccDockerContainer_basic
--- PASS: TestAccDockerContainer_basic (44.50s)
=== RUN   TestAccDockerContainer_volume
--- PASS: TestAccDockerContainer_volume (40.73s)
=== RUN   TestAccDockerContainer_customized
--- FAIL: TestAccDockerContainer_customized (50.27s)
	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   TestAccDockerContainer_upload
--- PASS: TestAccDockerContainer_upload (38.56s)
FAIL
exit status 1
FAIL	github.com/hashicorp/terraform/builtin/providers/docker	174.070s
Makefile:48: recipe for target 'testacc' failed
make: *** [testacc] Error 1
```

* Documentation changes.

* added maxitems and rerun tests
2017-03-07 18:48:20 +02:00
Michael Kuzmin
738e90507e provider/docker: Upload files into container before first start (#9520)
* Create uploads section for docker containers

* Upload a single file, load its content from state
2016-12-05 11:06:34 +00: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
James Nugent
4ec88d82ab provider/docker: don't crash with empty commands
If any of the entries in `commands` on `docker_container` resources was
empty, the assertion to string panic'd. Since we can't use ValidateFunc
on list elements, we can only really check this at apply time. If any
value is nil (resolves to empty string during conversion), we fail with
an error prior to creating the container.

Fixes #6409.
2016-04-29 18:54:45 -05:00
VERDOÏA Laurent
5cdb31fec1 provider/docker: #5298 Add support for docker run --user option 2016-04-04 21:43:59 -05:00
Colin Hebert
292c493762 Stop providing the hostConfig while starting the container 2016-02-13 22:04:51 +11:00
Colin Hebert
f763cd8b35 remove extra parenthesis 2016-01-31 08:49:35 +11:00
Colin Hebert
edd907c043 Catch potential custom network errors in docker 2016-01-31 08:31:30 +11: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
c823565d5d Fix typo 2016-01-04 21:03:53 +01:00
Colin Hebert
99f83853f7 Add the networks entry 2016-01-04 20:58:54 +01:00
Colin Hebert
1d60a86a14 Convert v to string 2016-01-01 10:12:43 +01:00
Colin Hebert
a44b873992 Add network_mode support to docker 2016-01-01 09:57:21 +01:00
Paul Bellamy
7bfa5f90b9 provider/docker: Add hosts parameter for containers 2015-12-03 10:32:41 +00:00
James Nugent
aa872d07c6 provider/docker: locate container via ID not name
This reapplies the patch mentioned in #3364 - for an unknown reason the
diff there was incorrect.
2015-12-02 17:27:24 -05:00
ryane
5a5f5ff988 docker: improve validation of runtime constraints 2015-11-09 19:36:23 -05:00
ryane
f1da40e648 include hostconfig when creating docker_container 2015-11-04 15:52:16 -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
Panagiotis Moustafellos
ce511d53db removed extra parentheses 2015-10-08 15:48:04 +03:00
Jeff Mitchell
8b4e37a42c As discussed on the issue, remove the hard-coded delay on startup in
favor of attempting to detect if the initial container ever enters
running state, and erroring out if not. It will re-check the container
once every 500ms for 15 seconds total; future work could make that
configurable.
2015-06-25 15:11:00 +00:00
Jeff Mitchell
fc6ef37d95 Fix a serious problem when using links.
Links cause there to be more than one name for a container to be
returned. As a result, only looking at the first element of the
container names could cause a container to not be found, leading
Terraform to remove it from state and attempt to recreate it.
2015-06-25 14:40:03 +00:00
Jeff Mitchell
40fed60ec4 When linking to other containers, introduce a slight delay; this lets
the Docker API get those containers running. Otherwise when
you try to start a container linking to them, the start command
will fail, leading to an error.
2015-06-25 14:40:03 +00:00
Mitchell Hashimoto
c2dc6c8234 fmt 2015-06-23 22:31:24 -07:00
Julian Schneider
b440ebc492 Add privileged option to docker container resource 2015-06-04 13:05:52 +02:00
Paul Hinze
9da91b1304 provider/docker: guard against nil NetworkSettings 2015-04-20 12:42:36 -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
Mitchell Hashimoto
75a5bedad0 providres/docker: cache client 2015-03-28 18:37:20 -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