Golang binaries compiled on-demand for your system

Go Binaries

Go Binaries is an on-demand binary server, allowing non-Go users to quickly install tools written in Go without installing go itself, and removing the burden of cross-compiling and uploading dozens of binaries for every command-line you write.

On-demand Go binary example

Usage

Install PKG with optional semver VERSION.

curl -sf https://gobinaries.com/<PKG>[@VERSION] | sh

Install PKG with optional semver VERSION to the given directory PREFIX. By default /usr/local/bin is used.

curl -sf https://gobinaries.com/<PKG>[@VERSION] | PREFIX=/tmp sh

The github.com path prefix is optional.

Examples

Install the hey HTTP benchmarking tool:

curl -sf https://gobinaries.com/rakyll/hey | sh

Install the wuzz HTTP client:

curl -sf https://gobinaries.com/asciimoo/wuzz | sh

Install the latest version of staticgen:

curl -sf https://gobinaries.com/tj/staticgen/cmd/staticgen | sh

Install the latest 1.x major version of staticgen:

curl -sf https://gobinaries.com/tj/staticgen/cmd/[email protected] | sh

Install the v1.0.0 version of triage:

curl -sf https://gobinaries.com/tj/triage/cmd/[email protected] | sh

Semver support

The following semver patterns are supported:

  • Exact version: v1.2.3, 1.2.3
  • Wildcards: v1.x, v1.2.x, 1.x, 1.2.x
  • Wildcards (implicit): v1, v1.2, 1.2
  • Leading v is optional, regardless of the Git tag

How does it work?

Take for example you want to install @rakyll's fantastic HTTP benchmarking tool hey, to install the latest release you would run:

curl -sf https://gobinaries.com/rakyll/hey | sh

This request fetches the latest tag from GitHub and responds with a shell script which performs a second request, populated with the resolved version and architecture as shown here:

https://gobinaries.com/binary/github.com/rakyll/hey?os=darwin&arch=amd64&version=v0.1.3

The response of this request is a Golang binary compiled for the requested os, architecture, and package version. The result is cached in a CDN for subsequent requests.

Limitations

  • The Go package must compile in under 100 seconds (CDN limitation)
  • The Go package must have at least one Git tag

FAQ

What's wrong with go-get? Using go-get for installation is fine if you're a Go user, however, if you're creating programs which are designed to be used by a wider audience it's unlikely they will have Go installed.
Which version of Go is used? Currently Go 1.13.x via the official golang:1.13 Docker image.

GoDoc

Sponsors

Sponsors

This project is sponsored by CTO.ai, making it easy for development teams to create and share workflow automations without leaving the command line.

And my GitHub sponsors:

Comments
  • Add support for +v2 modules

    Add support for +v2 modules

    This adds support to Go packages that have versions above v2. Similar to go get the /v2 major version has to be declared when making the package build request:

    Usage:

    # Explicit +v2 version
    curl -sf 'http://localhost:3000/nats-io/[email protected]' | PREFIX=. sh
    
    # Resolved version gets v2 from master
    curl -sf 'http://localhost:3000/nats-io/nats-server' | PREFIX=. sh
    
    # Explicit v1 version
    curl -sf 'http://localhost:3000/nats-io/[email protected]' | PREFIX=. sh
    
    # v2 nested modules too πŸŽ‰ 
    curl -sf 'http://localhost:3000/caddyserver/caddy/cmd/caddy' | PREFIX=. sh
    

    If the major version is not specified in the path, similar to go get and go modules, it will fallback to the v1 version of the package (even if the actual latest version is higher).

    curl --output - 'http://127.0.0.1:3000/binary/github.com/nats-io/nats-server?os=darwin&arch=amd64&version=v2.1.6' > my-nats-v1
    ./my-nats-v1 
    [98946] 2020/05/07 16:54:40.726190 [INF] Starting nats-server version 1.4.1
    

    Fixes #10

    Signed-off-by: Waldemar Quevedo [email protected]

  • adds a goproxy resolver

    adds a goproxy resolver

    Currently we've hardcoded the proxy, this is just a wip for now and will be configurable from the root.

    This is just a resolver for now to make sure that the code style, errors, and the small refactors look good here.

    The future direction of this would to be to attempt to use the goproxy resolver and then failing that, fall back to GitHub (but open to suggestions here).

    Please open an issue and discuss changes before spending time on them, unless the change is trivial or an issue already exists.

  • Chain of trust

    Chain of trust

    Feel free to ignore this issue, but I would like to understand what is the chain of trust of this installation method.

    Why should I trust this in ANY way? What you are building here is a rootkit as a service, piped through sudo sh.

    I know the immediate answer would be "If you don't trust this, do not use it", but there may be users without the expertise to understand the risks of using your product.

    Would you mind to add a disclaimer to the README explaining that using your product means the user is fully trusting you not being a malicious entity?

  • Execute install without sudo

    Execute install without sudo

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    I would like users to be able to install binaries with sudo, I just want to throw the binary in the current working directory.

    Fantastic work on this @tj this is going to make a HUGE difference for my project. I want users to get up and running quickly, convincing them to install Go before trying out Pion is sometimes a hurdle :)

    Steps to Reproduce

    curl -sf https://gobinaries.com/github.com/pion/example-webrtc-applications/twitch | PREFIX='pwd' sh wants root access when it doesn't need it.

    Maybe you can make this conditional? sudo being the default still works for me!

    Slack

    Join us on Slack https://chat.apex.sh/

  • Setting CGO_ENABLED=0

    Setting CGO_ENABLED=0

    This makes the binaries fully static also on Linux/amd64 so they work on Alpine too. Should fix #4

    To address the biggest concern: yes, this makes it impossible to build binaries that have dependencies on native code (CGo). This should not really be an issue, however: gobinaries is designed for cross-compilation, which means CGo wasn't usable before anyways. In fact, CGO_ENABLED is already disabled when cross-compiling; this PR disables it for Linux/amd64 too.

  • Missing detailed error message on 500 response

    Missing detailed error message on 500 response

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    Got Error downloading, got 500 response from server but don't know what went wrong exactly.

    Steps to Reproduce

    curl -sf https://gobinaries.com/juicedata/juicesync | sh
    
      ==> Downloading github.com/juicedata/juicesync@master
      ==> Resolved version master to v0.1.0
      ==> Downloading binary for darwin amd64
    
      Error downloading, got 500 response from server
    

    Slack

    Join us on Slack https://chat.apex.sh/

  • Error downloading, got 500 response from server

    Error downloading, got 500 response from server

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    When I try to install my cli tool I get this error:

    $ curl -sf https://gobinaries.com/montanaflynn/gocr/cmd/gocr | sh
      ==> Downloading github.com/montanaflynn/gocr/cmd/gocr@master
      ==> Resolved version master to v0.1.0
      ==> Downloading binary for darwin amd64
    
      Error downloading, got 500 response from server
    

    Building locally works: go build ./cmd/gocr

    Steps to Reproduce

    curl -sf https://gobinaries.com/montanaflynn/gocr/cmd/gocr | sh

  • Ability to build binaries not in root directory

    Ability to build binaries not in root directory

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    Not all projects have their main.go in the root; I would love to see some way to allow projects to specify where the entrypoint is using a .gobinaries file or something!

    Steps to Reproduce

    > curl -sf https://gobinaries.com/suborbital/hivew | sh
    
      ==> Downloading github.com/suborbital/hivew@master
      ==> Resolved version master to v0.0.1
      ==> Downloading binary for darwin amd64
    
      Error downloading, got 500 response from server
    

    Slack

    Join us on Slack https://chat.apex.sh/

  • Internal Server Error

    Internal Server Error

    https://github.com/evanw/esbuild/issues/66

    https://gobinaries.com/binary/github.com/evanw/esbuild?os=darwin&arch=amd64&version=v0.3.9
    

    Internal Server Error

  •  escape sequence with arrow prompt in zsh shell during downloading event

    escape sequence with arrow prompt in zsh shell during downloading event

    Prerequisites

    • [x] I searched to see if the issue already exists. Yes

    Description

    Escape sequence with arrow in zsh shell during downloading event
    ╭─sachin@legion ~
    β•°β”€βž€ curl -sf https://gobinaries.com/asciimoo/wuzz | sh

    \x1b[38;5;61m ==>\x1b[0;00m Downloading github.com/asciimoo/wuzz@master \x1b[38;5;61m ==>\x1b[0;00m Resolved version master to v0.4.0 \x1b[38;5;61m ==>\x1b[0;00m Downloading binary for linux amd64 \x1b[38;5;61m ==>\x1b[0;00m Installing wuzz to /usr/local/bin \x1b[38;5;61m ==>\x1b[0;00m Installation complete

    Attached a screenshot.

    Steps to Reproduce

    Tested with zsh shell. Still not sure if any fancy package missing from my side. gobinaries

    Slack

    Ok Join us on Slack https://chat.apex.sh/

  • Usage doesn't require sudo

    Usage doesn't require sudo

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    I tried the usage examples from the README, it always failed if I used it like so:

    Ξ» ahmgeek [~] β†’ curl -sf https://gobinaries.com/rakyll/hey | sudo sh
    Password:
    [3]  + 63329 done                   curl -sf https://gobinaries.com/rakyll/hey |
           63330 suspended (tty input)  sudo sh
    

    The prompt for the password exited immediately

    Fix

    It worked without sudo

    Ξ» ahmgeek [~] β†’ curl -sf https://gobinaries.com/rakyll/hey | sh
    
      ==> Downloading github.com/rakyll/hey@master
      ==> Resolved version master to v0.1.3
      ==> Downloading binary for darwin amd64
      ==> Installing hey to /usr/local/bin
    Password:
      ==> Installation complete
    

    Maybe remove it from the README ?

  • Increasing the version of Go used in the build

    Increasing the version of Go used in the build

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    HiπŸ‘‹οΌ The CLI using the features of the newer version than Go1.13 is not buildable, so it's time to raise the version.

    https://github.com/tj/gobinaries#faq

    Which version of Go is used? Currently Go 1.13.x via the official golang:1.13 Docker image.

  • is there a way to set CGO_ENABLED dynamically?

    is there a way to set CGO_ENABLED dynamically?

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description

    I am receiving the error Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work.

    Steps to Reproduce

    $ curl -sf https://gobinaries.com/hyperyuri/wallet-cli | sh
    
    $ wallet-cli
    

    Slack

    Join us on Slack https://chat.apex.sh/

  • Error downloading, got 500 response from server

    Error downloading, got 500 response from server

    Prerequisites

    • [x] I searched to see if the issue already exists.

    Description/Steps to Reproduce

    curl -sf https://gobinaries.com/tj/robo | sh
    
      ==> Downloading github.com/tj/robo@master
      ==> Resolved version master to v0.7.0
      ==> Downloading binary for darwin arm64
    
      Error downloading, got 500 response from server
    
  • How to uninstall software installed by gobinaries /missing docs

    How to uninstall software installed by gobinaries /missing docs

    Hi, I just installed a piece of software and it magically works. However I did not find any documentation on how to change (update, uninstall) software installed by gobinaires. Of course I can just remove the binary from my filesystem, but are there any leftovers then? Also it would be nice if there was a piece of documentation on this (what happens on my system when I install an app? How do I remove/update it?).

  • Support Windows through powershell

    Support Windows through powershell

    I created a powershell version of the script that works reasonably well. I think this could be released as some kind of alpha.

    Basically two changes:

    1. Add an install.ps1 template file
    2. Create a conditional at the endpoint that generates the script that detects if the user agent is a powershell and if so, renders the renderization of the install.ps1 template.

    Closes #2

GoReleaser builds Go binaries as fast and easily as possible
GoReleaser builds  Go binaries as fast and easily as possible

GoReleaser builds Go binaries for several platforms, creates a GitHub release and then pushes a Homebrew formula to a tap repository. All that wrapped in your favorite CI.

Jan 7, 2023
Embed static files in Go binaries (replacement for gobuffalo/packr)

Pkger github.com/markbates/pkger is a tool for embedding static files into Go binaries. It will, hopefully, be a replacement for github.com/gobuffalo/

Dec 29, 2022
Package binaries for different operating systems in a single script, executable everywhere.

CrossBin Packages MacOS, Linux and Windows binaries, into a single script that is executable everywhere and executes the correct binary for the system

Oct 24, 2022
CBuild build system - A tiny build system for C

cuild - CBuild A build system for C Building $ go build . Usage Similar to GNU Make, a file named "Cuildfile" is required. You have a few flags to us

Jan 17, 2022
Blueprint Build System For Golang

Blueprint Build System Blueprint is being archived on 2021 May 3. On 2021 May 3, we will be archiving the Blueprint project. This means it will not be

Nov 20, 2021
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.

#1 Golang live reload and task runner Content - ⭐️ Top Features - ???? Get started - ?? Config sample - ?? Commands List - ?? Support and Suggestions

Jan 6, 2023
go language generics system

Gotgo This document describes the third iteration of my attempt at a reasonable implementation of generics for go based on the idea of template packag

Dec 4, 2021
Build system and task runner for Go projects
Build system and task runner for Go projects

Gilbert is task runner that aims to provide declarative way to define and run tasks like in other projects like Gradle, Maven and etc.

Dec 21, 2022
A Distributed Continuous Integration System from MongoDB

Evergreen Evergreen is a distributed continuous integration system built by MongoDB. It dynamically allocates hosts to run tasks in parallel across ma

Dec 24, 2022
Please is a cross-language high-performance extensible build system for reproducible multi-language builds.

Please is a cross-language build system with an emphasis on high performance, extensibility and reproducibility. It supports a number of popular languages and can automate nearly any aspect of your build process.

Dec 30, 2022
πŸš€ gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.
πŸš€ gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.

gowatch δΈ­ζ–‡ζ–‡ζ‘£ gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file. Installation To insta

Dec 30, 2022
packM 🧬 is fivem resource compiler for golang with the power of golang+typescript+webpack

packM ?? packM ?? is fivem resource compiler for golang ,typescript with the power of golang+typescript compiler+webpack

Jun 28, 2022
Various tools for usage with Golang like installer, github tool and cloud features.

Gopei2 (Go Programming Environment Installer) Gopei shell install Go compiler, LiteIDE and configure for you the entire environment, variables, paths,

Dec 23, 2022
Small golang app to assist in managing extended hdwallet keys

Installation go install github.com/provenance-io/extkey/cmd/extkey@latest Encoding Key generation interactive # Using interactive mode β–·β–· extkey Mne

Aug 15, 2022
Scan and analyze OSS dependencies and licenses from compiled Go binaries
Scan and analyze OSS dependencies and licenses from compiled Go binaries

golicense - Go Binary OSS License Scanner golicense is a tool that scans compiled Go binaries and can output all the dependencies, their versions, and

Nov 6, 2022
πŸ“¦ An independent package manager for compiled binaries.
πŸ“¦ An independent package manager for compiled binaries.

stew An independent package manager for compiled binaries. Features Easily distribute binaries across teams and private repositories. Get the latest r

Dec 13, 2022
Live on-demand transcoding in go using ffmpeg. Also with NVIDIA GPU hardware acceleration.

Go live HTTP on-demand transcoding Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of custo

Dec 16, 2022
Tiny binary serializer and deserializer to create on demand parsers and compilers

Parco Hobbyist binary compiler and parser built with as less reflection as possible, highly extensible and with zero dependencies. There are plenty pa

Nov 9, 2022
Nydus-snapshotter - A containerd snapshotter with capability of on-demand read

Nydus Snapshotter Nydus-snapshotter is a non-core sub-project of containerd. Pul

Dec 14, 2022
log on demand for Go.

logondemand log on demand for Go.

Feb 14, 2022