-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forego binary support for alpinelinux #65
Comments
+1, would appreciate a musl build with static linking as glibc has its quirks with static linking and makes the binary really large Nonstatic build for Alpine: docker run -ti --name build-forego alpine:edge sh
# Enter Docker Shell
apk update && apk upgrade && apk add go musl-dev git
mkdir /go && export GOPATH=/go
go get github.com/ddollar/forego
# Leave Docker shell
docker cp build-forego:/go/bin/forego dist/forego I'm working on the fully static one. |
Fully static stripped build (5.9MiB) now working :) #!/bin/bash
docker run -i --rm golang:1.5.1 > forego <<END
apt-get update 1> /dev/null && apt-get install -yy musl-dev musl-tools 1> /dev/null
go get github.com/ddollar/forego 1> /dev/null
cd /go/src/github.com/ddollar/forego 1> /dev/null
CC=musl-gcc go build --ldflags '-linkmode external -extldflags "-static -s"' 1> /dev/null
cat forego
END This pulls |
@ddollar Can we get this new build process integrated for the new binary releases? There are no downsides to these binaries, they are even smaller than the ones you are currently distributing and they work absolutely everywhere where you have Linux x64, even on a bare kernel or in otherwise empty Docker images. I don't know how you build your binaries but you could just drop my code above into a bash script and you'd get a fully built version in the working directory. |
@lorenz Using |
@md5 at the moment the console output of the script is only the error stream. This is what it generates on my machine:
|
I just realized that would mess with the final "cat" too.
|
Now that jwilder includes (docker >= 1.8.0 )mounts in the runtime container, use his supported version. Note that this is a BREAKING CHANGE, as the cyberCode version stores the mounts and volumes in the same runtime container data structure (Volumes) and the jwilder version stores them separately. This means that templates developed for docker < 1.8.0 cannot be reused as-is. Also build static musl forego instead of glibc. Approach taken from: ddollar/forego#65 (comment)
Looks like there's work in progress on creating official alpine-based nginx images; https://github.com/nginxinc/docker-nginx/blob/master/mainline/alpine/Dockerfile, and ran into this; are there still plans to ship an alpine-compatible binary? |
Someone figure out how to do this with Equinox and I'll add it! /cc @inconshreveable |
Yeah, I have this same problem with ngrok. Your options (at the moment) are:
I have this problem with static builds and GOARM=5, so we'll get native support into equinox to deal with this problem, just not sure when it will land. |
Linux precompiled binary doesnt work with alpinelinux.
Could come useful for people who are very keen on docker image size.
forego is much lightweight compared to supervisor which also requires other dependencies.
Its been compiled for personal use by using the below command
Here is the link to the working alpinelinux binary.
Thanks.
The text was updated successfully, but these errors were encountered: