Skip to content

Instantly share code, notes, and snippets.

@dbaba
Created September 7, 2014 06:32
Show Gist options
  • Save dbaba/749a1fbe4abbeca706df to your computer and use it in GitHub Desktop.
Save dbaba/749a1fbe4abbeca706df to your computer and use it in GitHub Desktop.
To sync system clock on Boot2docker instance. Run this from the guest OS.
#!/bin/sh
ID_FILE_PATH=~/.ssh/id_boot2docker
B2D_PORT=2022
NTP_SERVER=time.asia.apple.com
CMD="sudo ntpclient -s -h ${NTP_SERVER}"
ssh -i ${ID_FILE_PATH} -p ${B2D_PORT} -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" docker@localhost "${CMD}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment