[LINUX] docker / docker-compose versioned installation (up | down)

Installation notes

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

Release notes

https://docs.docker.com/engine/release-notes/ https://docs.docker.com/compose/release-notes/

Recommended Posts

docker / docker-compose versioned installation (up | down)
Docker installation
Launch Django on a Docker container with docker-compose up
Docker Easy Installation Procedure (CentOS)
Until docker-compose up on CentOS7