mirror of
https://github.com/boringproxy/boringproxy.git
synced 2024-07-07 04:42:58 -05:00
Use multi stage dockerfile for building
This also adds a docker-compose.yml for easy running and rebuilding Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
parent
e93fc79f23
commit
eacc0094aa
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
Dockerfile
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM golang:1.15-alpine3.12 as builder
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN apk add git
|
||||||
|
RUN go get github.com/GeertJohan/go.rice/rice
|
||||||
|
|
||||||
|
COPY go.* ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN rice embed-go
|
||||||
|
RUN CGO_ENABLED=0 go build
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
EXPOSE 80 443
|
||||||
|
|
||||||
|
COPY --from=builder /build/boringproxy /
|
||||||
|
|
||||||
|
ENTRYPOINT ["/boringproxy"]
|
||||||
|
CMD ["server"]
|
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
version: '3.5'
|
||||||
|
services:
|
||||||
|
boringproxy:
|
||||||
|
build: ./
|
||||||
|
image: boringproxy
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
|
@ -1,14 +0,0 @@
|
||||||
FROM ubuntu:16.04
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl git
|
|
||||||
|
|
||||||
RUN git clone https://github.com/boringproxy/boringproxy
|
|
||||||
WORKDIR boringproxy
|
|
||||||
RUN ./install_go.sh
|
|
||||||
ENV PATH="${PATH}:/usr/local/go/bin"
|
|
||||||
ENV PATH="${PATH}:/root/go/bin"
|
|
||||||
RUN go get github.com/GeertJohan/go.rice/rice
|
|
||||||
RUN rice embed-go
|
|
||||||
RUN go build
|
|
||||||
|
|
||||||
CMD ./boringproxy server
|
|
Loading…
Reference in New Issue
Block a user