Skip to content

Instantly share code, notes, and snippets.

@adamz01h
Last active July 24, 2024 20:46
Show Gist options
  • Select an option

  • Save adamz01h/19d4cffa00e9b06ac33d514487d70744 to your computer and use it in GitHub Desktop.

Select an option

Save adamz01h/19d4cffa00e9b06ac33d514487d70744 to your computer and use it in GitHub Desktop.
lazydockerdownload
# map different architecture variations to the available binaries
ARCH=$(uname -m)
case $ARCH in
i386|i686) ARCH=x86 ;;
armv6*) ARCH=armv6 ;;
armv7*) ARCH=armv7 ;;
aarch64*) ARCH=arm64 ;;
esac
# prepare the download URL
GITHUB_LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/jesseduffield/lazydocker/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
GITHUB_FILE="lazydocker_${GITHUB_LATEST_VERSION//v/}_$(uname -s)_${ARCH}.tar.gz"
GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${GITHUB_LATEST_VERSION}/${GITHUB_FILE}"
# install/update the local binary
curl -L -o lazydocker.tar.gz $GITHUB_URL
tar xzvf lazydocker.tar.gz lazydocker
rm lazydocker.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment