mirror of
https://github.com/containrrr/watchtower.git
synced 2025-03-03 15:32:37 +02:00
Cannot load host Docker config from container. Remove option and rely on environment variables
This commit is contained in:
parent
1c59200565
commit
541264281c
@ -39,7 +39,7 @@ docker run -d \
|
|||||||
centurylink/watchtower
|
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 \
|
docker run -d \
|
||||||
|
@ -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
|
var opts types.ImagePullOptions // ImagePullOptions can take a RegistryAuth arg to authenticate against a private registry
|
||||||
auth, err := EncodedEnvAuth(imageName)
|
auth, err := EncodedEnvAuth(imageName)
|
||||||
if err != nil {
|
|
||||||
// credentials environment vars not set, trying Docker config instead
|
|
||||||
auth, err = EncodedConfigAuth(imageName)
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("No authentication credentials found")
|
log.Debug("No authentication credentials found")
|
||||||
opts = types.ImagePullOptions{}
|
opts = types.ImagePullOptions{}
|
||||||
|
@ -48,6 +48,7 @@ func EncodedEnvAuth(ref string) (string, error) {
|
|||||||
/*
|
/*
|
||||||
* Return an encoded auth config for the given registry
|
* Return an encoded auth config for the given registry
|
||||||
* loaded from the docker config
|
* loaded from the docker config
|
||||||
|
* The docker config must be mounted on the container
|
||||||
*/
|
*/
|
||||||
func EncodedConfigAuth(ref string) (string, error) {
|
func EncodedConfigAuth(ref string) (string, error) {
|
||||||
server, err := ParseServerAddress(ref)
|
server, err := ParseServerAddress(ref)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user