2017-02-17 13:31:26 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cat > Dockerfile.builder <<EOF
|
|
|
|
FROM golang
|
|
|
|
|
|
|
|
MAINTAINER Denis Zheleztsov <difrex.punk@gmail.com>
|
|
|
|
|
|
|
|
ENV GOPATH /usr
|
|
|
|
|
|
|
|
RUN go get github.com/Difrex/zoorest/rest
|
|
|
|
RUN cd /usr/src/github.com/Difrex/zoorest && go get -t -v ./...
|
|
|
|
|
|
|
|
WORKDIR /usr/src/github.com/Difrex/zoorest
|
|
|
|
|
|
|
|
ENTRYPOINT go build -ldflags "-linkmode external -extldflags -static" && mv zoorest /out
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Build builder
|
2017-06-22 17:06:39 +03:00
|
|
|
docker build --no-cache -t zoorest_builder -f Dockerfile.builder .
|
2017-02-17 13:31:26 +03:00
|
|
|
# Build bin
|
2017-04-17 12:33:05 +03:00
|
|
|
docker run -v $(pwd)/out:/out zoorest_builder
|
2017-02-17 13:31:26 +03:00
|
|
|
|
|
|
|
case $1 in alpine)
|
|
|
|
docker build -t zoorest -f Dockerfile .
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|