-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a538260
commit 71c88d7
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
# docker-time-sync-agent | ||
Tool to prevent time drift in Docker for Mac's VM. | ||
`docker-time-sync-agent` is a tool to prevent time drift in Docker for Mac's HyperKit VM. | ||
|
||
Docker daemon fails to update the VM's time after computer wakes up from sleep. The result is that VM's clock will be set to a past time. This inturn will make Docker containers use that time. | ||
|
||
So what's the problem if the container's use a wrong time ? | ||
Some services (like S3, Okta) will block requests orginating from a source whose time is wrong. Few examples: | ||
|
||
* Uploading to S3 will retun a `403 Forbidden` | ||
* SAML Authentication with Okta will fail | ||
|
||
`docker-time-sync-agent` listens to system wakeup event and runs a shell script (`update-docker-time`) that updates the VM's time. | ||
|
||
Using `launchd`, `docker-time-sync-agent` can be made to autostart during login so that on every wakeup, time sync happens automatically. | ||
|
||
## Installation | ||
|
||
### Auto | ||
|
||
**WIP** | ||
|
||
### Manual | ||
1. Download the latest binaries from releases page | ||
2. `unzip Binaries-Vx.y.z.zip` | ||
3. `mv /Binaries-Vx.y.z/docker-time-sync-agent /usr/local/bin/` | ||
4. `mv /Binaries-Vx.y.z/update-docker-time /usr/local/bin/` | ||
5. Download this file [io.github.arunvelsriram.docker-time-sync-agent.plist](io.github.arunvelsriram.docker-time-sync-agent.plist) | ||
6. Open it and replace 'YOUR_USERNAME' with your Mac's username | ||
7. `mv /path/to/io.github.arunvelsriram.docker-time-sync-agent.plist` `~/Library/LaunchAgents/` | ||
8. `launchctl load ~/Library/LaunchAgents/io.github.arunvelsriram.docker-time-sync-agent.plist` | ||
9. Use `Console.app` and `~/.docker-time-sync-agent.log` file to see the logs | ||
10. Put the computer in sleep mode and wake it up. After 30s from wakeup, time sync will happen | ||
|
||
## Contributing | ||
**Contributions are welcome** | ||
This is a Xcode Command Line Tool project. Clone the repo and open `docker-time-sync-agent.xcodeproj` in Xcode. |