|
| 1 | +FROM golang:cross |
| 2 | + |
| 3 | +ENV CGO_ENABLED 0 |
| 4 | + |
| 5 | +# Install Godep for vendoring |
| 6 | +RUN go get github.com/tools/godep |
| 7 | +# Recompile the standard library without CGO |
| 8 | +RUN go install -a std |
| 9 | + |
| 10 | +RUN apt-get install -y -q git |
| 11 | + |
| 12 | +#RUN go get -d github.com/docker/docker github.com/Sirupsen/logrus github.com/dustin/go-humanize github.com/kardianos/osext golang.org/x/crypto/ssh/terminal |
| 13 | + |
| 14 | +# Declare the maintainer |
| 15 | +MAINTAINER Scaleway Team < [email protected]> (@scaleway) |
| 16 | + |
| 17 | +# For convenience, set an env variable with the path of the code |
| 18 | +ENV APP_DIR /go/src/github.com/scaleway/scaleway-cli |
| 19 | + |
| 20 | +ADD . /go/src/github.com/scaleway/scaleway-cli |
| 21 | + |
| 22 | +#RUN cd $APP_DIR && godep get && godep save |
| 23 | + |
| 24 | +# Compile the binary and statically link |
| 25 | +RUN cd $APP_DIR && GOOS=darwin GOARCH=amd64 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Darwin-x86_64 |
| 26 | +RUN cd $APP_DIR && GOOS=darwin GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Darwin-i386 |
| 27 | +RUN cd $APP_DIR && GOOS=linux GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Linux-x86_64 |
| 28 | +RUN cd $APP_DIR && GOOS=linux GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Linux-i386 |
| 29 | +RUN cd $APP_DIR && GOOS=linux GOARCH=arm GOARM=5 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Linux-arm |
| 30 | +RUN cd $APP_DIR && GOOS=linux GOARCH=arm GOARM=6 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Linux-armv6 |
| 31 | +RUN cd $APP_DIR && GOOS=linux GOARCH=arm GOARM=7 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Linux-armv7 |
| 32 | +RUN cd $APP_DIR && GOOS=freebsd GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Freebsd-x86_64 |
| 33 | +RUN cd $APP_DIR && GOOS=freebsd GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Freebsd-i386 |
| 34 | +RUN cd $APP_DIR && GOOS=freebsd GOARCH=arm GOARM=5 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Freebsd-arm |
| 35 | +#RUN cd $APP_DIR && GOOS=openbsd GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Openbsd-x86_64 |
| 36 | +#RUN cd $APP_DIR && GOOS=openbsd GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Openbsd-i386 |
| 37 | +#RUN cd $APP_DIR && GOOS=openbsd GOARCH=arm GOARM=5 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Openbsd-arm |
| 38 | +RUN cd $APP_DIR && GOOS=windows GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Windows-x86_64 |
| 39 | +#RUN cd $APP_DIR && GOOS=windows GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Windows-i386 |
| 40 | +#RUN cd $APP_DIR && GOOS=windows GOARCH=arm GOARM=5 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Windows-arm |
0 commit comments