function version () {
[ -e $1 ] && $1 -v | sed -r 's/.* ([\.0-9]+), .*$/\1/'
}
VER=19.03.8
BIN=/usr/bin/docker
if [ $(version $BIN) != $VER ]; then
curl -s -fsSL https://get.docker.com \
| sed 's/sleep [0-9]*//' \
| sed 's/apt-get install/apt-get install --allow-downgrades/' \
| VERSION=${VER} sh
fi
VER=1.24.1
BIN=/usr/bin/docker-compose
if [ $(version $BIN) != $VER ]; then
URL=https://github.com/docker/compose/releases/download/${VER}/docker-compose-$(uname -s)-$(uname -m)
curl -s -L $URL -o ${BIN}
chmod +x ${BIN}
fi
https://docs.docker.com/engine/release-notes/ https://docs.docker.com/compose/release-notes/