forked from scaleway/scaleway-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (31 loc) · 2.54 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM golang:cross
ENV CGO_ENABLED 0
# Install Godep for vendoring
RUN go get github.com/tools/godep
# Recompile the standard library without CGO
RUN go install -a std
RUN apt-get install -y -q git
# Declare the maintainer
MAINTAINER Scaleway Team <[email protected]> (@scaleway)
# For convenience, set an env variable with the path of the code
ENV APP_DIR /go/src/github.com/scaleway/scaleway-cli
ADD . /go/src/github.com/scaleway/scaleway-cli
#RUN cd $APP_DIR && godep get && godep save
# Compile the binary and statically link
RUN cd $APP_DIR && GOOS=darwin GOARCH=amd64 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Darwin-x86_64
RUN cd $APP_DIR && GOOS=darwin GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Darwin-i386
RUN cd $APP_DIR && GOOS=linux GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Linux-i386
#RUN cd $APP_DIR && GOOS=linux GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Linux-x86_64
RUN cp /go/bin/scw-Linux-i386 /go/bin/scw-Linux-x86_64
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
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
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
RUN cd $APP_DIR && GOOS=freebsd GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Freebsd-x86_64
RUN cd $APP_DIR && GOOS=freebsd GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Freebsd-i386
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
#RUN cd $APP_DIR && GOOS=openbsd GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Openbsd-x86_64
#RUN cd $APP_DIR && GOOS=openbsd GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Openbsd-i386
#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
RUN cd $APP_DIR && GOOS=windows GOARCH=amd64 godep go build -a -v -ldflags '-w -s' -o /go/bin/scw-Windows-x86_64.exe
#RUN cd $APP_DIR && GOOS=windows GOARCH=386 godep go build -a -v -ldflags '-d -w -s' -o /go/bin/scw-Windows-i386
#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