https://github.com/arunvelsriram/docker-time-sync-agent
docker-time-sync-agent is a tool to prevent time drift in Docker for Mac's HyperKit VM.
https://github.com/arunvelsriram/docker-time-sync-agent
docker osx
Last synced: about 1 year ago
JSON representation
docker-time-sync-agent is a tool to prevent time drift in Docker for Mac's HyperKit VM.
- Host: GitHub
- URL: https://github.com/arunvelsriram/docker-time-sync-agent
- Owner: arunvelsriram
- License: apache-2.0
- Created: 2016-12-25T23:00:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-14T19:59:45.000Z (over 8 years ago)
- Last Synced: 2025-03-28T05:31:35.274Z (about 1 year ago)
- Topics: docker, osx
- Language: Objective-C
- Homepage:
- Size: 24.4 KB
- Stars: 152
- Watchers: 9
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
**Note:** Time drift issue is fixed in latest version of Docker for Mac. Please check [https://github.com/docker/for-mac/issues/17](https://github.com/docker/for-mac/issues/17).
# docker-time-sync-agent
`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. Time sync can be triggered manually anytime by running `update-docker-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
`curl https://raw.githubusercontent.com/arunvelsriram/docker-time-sync-agent/master/install.sh | bash`
### 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
## Uninstallation
### Manual
1. Run the following commands from your terminal:
```
launchctl unload ~/Library/LaunchAgents/io.github.arunvelsriram.docker-time-sync-agent.plist
rm -f ~/Library/LaunchAgents/io.github.arunvelsriram.docker-time-sync-agent.plist
rm -f /usr/local/bin/docker-time-sync-agent
rm -f /usr/local/bin/update-docker-time
rm -f ~/.docker-time-sync-agent.log
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)