Skip to content

Instantly share code, notes, and snippets.

@euank
Created August 30, 2017 04:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save euank/b37eb989d7999e18672ad9637a96b377 to your computer and use it in GitHub Desktop.
Save euank/b37eb989d7999e18672ad9637a96b377 to your computer and use it in GitHub Desktop.
This resolves a docker/docker-ce tag into a moby commit hash.
#!/bin/bash
set -e
tag=${1:?arg should be a docker-ce tag, such as 'v17.07.0-ce'}
tmp=$(mktemp -d)
cd $tmp
wget https://raw.githubusercontent.com/shykes/moby-extras/master/cmd/moby-components
chmod +x moby-components
git clone https://github.com/docker/docker-ce
cd docker-ce
git checkout $tag
# upstreamCommit is their termonology. That's not the real upstream commit
upstreamCommit=$(../moby-components list | grep engine | awk -F: '{print $4}')
# echo to trim some spaces
echo $(git show "${upstreamCommit}" | grep 'Upstream-commit' | awk -F: '{print $2}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment