From 3a79b4a34948e27171e0515b6692431a9f1029c3 Mon Sep 17 00:00:00 2001 From: Suyash Kumar Date: Sat, 9 Mar 2019 16:41:29 -0500 Subject: [PATCH] Build binaries from source using Docker (#14) This change makes it easy to reproducibly build ssl-proxy for multiple platforms via Docker. --- Dockerfile | 6 ++++++ README.md | 13 +++++++++++-- docker-compose.build.yml | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.build.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6cabbe2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.12-alpine3.9 +WORKDIR /go/src/github.com/suyashkumar/ssl-proxy +RUN apk add --no-cache make git zip +RUN go get -u github.com/golang/dep/cmd/dep +COPY . . +RUN make diff --git a/README.md b/README.md index 30a78eb..e8292d0 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,17 @@ If you're using `wget`, you can fetch and uncompress the proper binary in one co wget -qO- $BINARY_RELEASE_LINK | tar xvz ``` -### Build from source -You must have Golang installed on your system along with `make` and [`dep`](https://github.com/golang/dep). Then simply clone the repository and run `make`. +### Build from source +#### Build from source using Docker +You can build `ssl-proxy` for all platforms quickly using the included Docker configurations. + +If you have `docker-compose` installed: +```sh +docker-compose -f docker-compose.build.yml up +``` +will build linux, osx, and darwin binaries (x86) and place them in a `build/` folder in your current working directory. +#### Build from source locally +You must have Golang installed on your system along with `make` and [`dep`](https://github.com/golang/dep). Then simply clone the repository and run `make`. ## Attribution Icons made by Those Icons from www.flaticon.com is licensed by CC 3.0 BY diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..3d3b6eb --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,7 @@ +version: '2' +services: + build-release: + build: . + volumes: + - $PWD/build:/go/src/github.com/suyashkumar/ssl-proxy/build + command: make release