Skip to content

Commit

Permalink
Merge pull request #12 from film42/gt/some_stugg
Browse files Browse the repository at this point in the history
Upgrade to go 1.11 and use multi-stage docker container from scratch
  • Loading branch information
film42 authored Oct 6, 2018
2 parents f9ffaec + 751cc94 commit f886386
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM golang:1.8.1-alpine
FROM golang:1.11-alpine as builder
ADD . /turbulence
WORKDIR /turbulence
ENV GOPATH /turbulence
RUN go build
ENTRYPOINT ["/turbulence/turbulence"]
RUN CGO_ENABLED=0 go build

FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /turbulence/turbulence /
ENTRYPOINT ["/turbulence"]
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ $ go get github.com/film42/turbulence
$ ./bin/turbulence
```

Or you can grab the pre-built docker container:
Or you can grab the pre-built docker container with default options:

```
$ docker run -p 26000:26000 -d film42/turbulence:latest --config test/config.json
$ docker run -p 25000:25000 -d film42/turbulence:latest
```

Or use your own config:

```
$ docker run -p 26000:26000 -d -v $(pwd)/test:/config film42/turbulence:latest --config config/config.json
```

### Configuring
Expand Down
4 changes: 2 additions & 2 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ func (c *connection) Handle() {
logger.Info.Println(c.id, "Processing connection to:", request.Method, request.Host)

if request.Method == "CONNECT" {
c.proxy = &httpsProxy{}
c.proxy = new(httpsProxy)
} else {
c.proxy = &httpProxy{}
c.proxy = new(httpProxy)
}

err = c.proxy.SetupOutgoing(c, request)
Expand Down

0 comments on commit f886386

Please sign in to comment.