Skip to content

Commit

Permalink
Better cross platform builds (#118)
Browse files Browse the repository at this point in the history
* Reverted Dockerfile to alpine base for quicker builds and smaller images

* Added CGO_ENABLED=0 to compile
  • Loading branch information
febbraro authored Nov 10, 2017
1 parent 3f6406a commit 7f9429d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project_name: outrigger-cli
builds:
- binary: rig
main: ./cmd/main.go
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
Expand Down
33 changes: 14 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
FROM golang:1.9
FROM golang:1.9-alpine

# Install Ruby
WORKDIR /tmp
RUN apt-get -y update \
&& apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
RUN wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.2.tar.gz \
&& tar xzf ruby-2.4.2.tar.gz \
&& cd ruby-2.4.2 \
&& ./configure --prefix=/usr/local \
&& make \
&& make install
RUN apk add --no-cache \
ca-certificates \
git \
gcc \
libffi-dev \
make \
musl-dev \
rpm \
ruby \
ruby-dev \
tar

# Install fpm for package building
RUN apt-get install -y rpm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& gem install --no-rdoc --no-ri fpm

# Back to the Go thingies
WORKDIR /go
RUN go get -u github.com/golang/dep/... \
&& go get -u github.com/alecthomas/gometalinter \
&& go get -u github.com/goreleaser/goreleaser

RUN gometalinter --install --update
RUN gem install --no-rdoc --no-ri fpm
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
environment:
GOOS: ${GOOS:-darwin}
GOARCH: ${GOARCH:-amd64}
CGO_ENABLED: 0

# Install project dependencies.
install:
Expand Down

0 comments on commit 7f9429d

Please sign in to comment.