From c2597e760c5d8bb22f789a5ea43f1c89f40bb1a0 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 10 Mar 2018 20:20:56 +0530 Subject: [PATCH 1/2] Adds warning about the link feature --- website/docs/r/container.html.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/docs/r/container.html.markdown b/website/docs/r/container.html.markdown index a267cb24..779c8eda 100644 --- a/website/docs/r/container.html.markdown +++ b/website/docs/r/container.html.markdown @@ -53,6 +53,12 @@ The following arguments are supported: container. * `links` - (Optional, set of strings) Set of links for link based connectivity between containers that are running on the same host. + +~> **Warning** The --link flag is a legacy feature of Docker. It may eventually +be removed. It exposes _all_ environment variables originating from Docker to +any linked containers. This could have serious security implications if sensitive +data is stored in them. See [the docker documentation][linkdoc] for more details. + * `hostname` - (Optional, string) Hostname of the container. * `domainname` - (Optional, string) Domain name of the container. * `restart` - (Optional, string) The restart policy for the container. Must be @@ -173,3 +179,6 @@ The following attributes are exported: NetworkSettings. * `bridge` - The network bridge of the container as read from its NetworkSettings. + + +[linkdoc] https://docs.docker.com/network/links/ \ No newline at end of file From 49bb47b68d6777c888fe4b0b7f435bc62a087e6e Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 2 Apr 2018 11:49:45 +0530 Subject: [PATCH 2/2] Marks the links property as deprecated --- docker/resource_docker_container.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker/resource_docker_container.go b/docker/resource_docker_container.go index c50aa92b..a5536cd0 100644 --- a/docker/resource_docker_container.go +++ b/docker/resource_docker_container.go @@ -259,11 +259,12 @@ func resourceDockerContainer() *schema.Resource { }, "links": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Deprecated: "The --link flag is a legacy feature of Docker. It may eventually be removed.", }, "ip_address": &schema.Schema{