Skip to content

Instantly share code, notes, and snippets.

@micahyoung
Created May 12, 2020 12:27
Show Gist options
  • Save micahyoung/86631de6137f3731b47465c3ad587d53 to your computer and use it in GitHub Desktop.
Save micahyoung/86631de6137f3731b47465c3ad587d53 to your computer and use it in GitHub Desktop.
Get Docker Daemon Windows Host OS Version
ARG os_tag
FROM mcr.microsoft.com/windows/servercore:${os_tag}
...
# parses this reponse for "1809": `"KernelVersion": "10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)"`
export os_tag=$(docker system info -f '{{index (split .KernelVersion ".") 5 | printf "%.4s"}}')
docker build --tag lifecycle-test --build-arg os_tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment