-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to config.json are not picked up #451
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
I am also having this issue. I have been debugging it for the last few days and like you have found when the file is updated on the host it is not updated on the watchtower server. I read that as the file is being changed by something like docker the bind mount is being broken. A potential workaround for this being broken is to mount a directory rather than a single file however in this case this is not possible due to the config.json having to be at the root of the watchtower image. If config.json was stored inside a folder then this workaround may work. |
Thank you for the report! Feel free to have a go at implementing this change! I'd be happy to assist with reviews and direction to the best of my ability. 🙏🏼 |
So I did a little digging and I found the following:
I tested this out: when I edit the file with However, as far as Actually, an alternative suggestion would be to make the location configurable by the user, but still defaulting to |
hi, i have the same issue. it loads only the old login data. no idea what can i do. docker login at the host works fine. |
@tammert Did you try out the approach with symlinking the config file and mounting the symlink rather than the immediate file, as described in the issue you linked? That seems to have solved it for some. 🤷♂️ As in: $ ln -s ~/.docker/config.json ~/.docker/linked-config.json and then mounting |
@simskij haven't checked that actually, but I'm sure it would work as you described. So I think if we want to solve this issue, we can either: I don't have a strong preference either way, but I wouldn't mind implementing either of the 3. Any thoughts? |
I'm leaning towards option a, as that adds no additional complexity to watchtower, relies on well-established OS features and once set-up, gets rid of the manual labor. Would be awesome if you wanted to take lead on that 👍 |
@simskij PR is up for option a! |
To avoid important communication to get lost in a closed issues no one monitors, I'll go ahead and lock this issue. If you want to continue the discussion, please open a new issue. Thank you! 🙏🏼 |
Describe the bug
If
config.json
is modified outside of the Watchtower container withdocker login
, the changes are not reflected by Watchtower until a restart.To Reproduce
Steps to reproduce the behavior:
/root/.docker/config.json
with the following contents:{ "auths": { } }
Watchtower at this point is running as:
docker login
to some repository, which updates/root/.docker/config.json
.Expected behavior
Watchtower should reread
config.json
if it changes. This will prevent having to restart Watchtower if credentials change, or new credentials are added/removed withlogin
/logout
.Screenshots
N/A
Environment
Logs from running watchtower with the
--debug
optionShown above.
Additional context
The text was updated successfully, but these errors were encountered: