Created
January 18, 2026 21:52
-
-
Save HauptJ/4955360ef3f84bc278e2da88ca318dde to your computer and use it in GitHub Desktop.
Bash script to install Ko on Linux
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
| #!/usr/bin/env bash | |
| set -e | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi | |
| version=0.18.1 | |
| bin_name=ko | |
| arch=$(uname -m) | |
| tmp_dl_path=/tmp/$bin_name.tar.gz | |
| tmp_bin_path=/tmp/$bin_name | |
| install_path=/usr/local/bin | |
| case $arch in | |
| x86_64) | |
| curl -Lo $tmp_dl_path https://github.com/ko-build/ko/releases/download/v$version/ko_${version}_Linux_x86_64.tar.gz | |
| ;; | |
| aarch64) | |
| curl -Lo $tmp_dl_path https://github.com/ko-build/ko/releases/download/v$version/ko_${version}_Linux_arm64.tar.gz | |
| ;; | |
| *) | |
| echo "unsupported architecture" | |
| exit 1 | |
| ;; | |
| esac | |
| tar -xzvf $tmp_dl_path -C $install_path $bin_name | |
| chmod +x $install_path/$bin_name | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment