Created
August 30, 2017 04:00
-
-
Save euank/b37eb989d7999e18672ad9637a96b377 to your computer and use it in GitHub Desktop.
This resolves a docker/docker-ce tag into a moby commit hash.
This file contains hidden or 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
#!/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