From 541264281c4ba69bd8bf2634868a46aa79b21bb4 Mon Sep 17 00:00:00 2001 From: Ross Cadogan Date: Tue, 18 Oct 2016 14:51:44 +0100 Subject: [PATCH] Cannot load host Docker config from container. Remove option and rely on environment variables --- README.md | 2 +- container/client.go | 4 ---- container/trust.go | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fd98414..f9197e8 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ docker run -d \ centurylink/watchtower ``` -If pulling images from a private Docker registry, supply any authentication credentials with the environment variables `REPO_USER` and `REPO_PASS` or omit to leave watchtower load credentials from the default Docker config (`~/.docker/config.json`): +If pulling images from a private Docker registry, supply any authentication credentials with the environment variables `REPO_USER` and `REPO_PASS`. ``` docker run -d \ diff --git a/container/client.go b/container/client.go index 0917c9b..c02a1d8 100644 --- a/container/client.go +++ b/container/client.go @@ -148,10 +148,6 @@ func (client dockerClient) IsContainerStale(c Container) (bool, error) { var opts types.ImagePullOptions // ImagePullOptions can take a RegistryAuth arg to authenticate against a private registry auth, err := EncodedEnvAuth(imageName) - if err != nil { - // credentials environment vars not set, trying Docker config instead - auth, err = EncodedConfigAuth(imageName) - } if err != nil { log.Debug("No authentication credentials found") opts = types.ImagePullOptions{} diff --git a/container/trust.go b/container/trust.go index 871e6aa..b77df57 100644 --- a/container/trust.go +++ b/container/trust.go @@ -48,6 +48,7 @@ func EncodedEnvAuth(ref string) (string, error) { /* * Return an encoded auth config for the given registry * loaded from the docker config + * The docker config must be mounted on the container */ func EncodedConfigAuth(ref string) (string, error) { server, err := ParseServerAddress(ref)