Dockerfile 682 B

1234567891011121314151617
  1. ############################
  2. # STEP 1 build executable binary
  3. ############################
  4. FROM golang:alpine AS builder
  5. RUN apk update && apk add --no-cache git bash wget
  6. WORKDIR /go/src/v2ray.com/core
  7. RUN git clone --progress --depth=1 https://github.com/v2fly/v2ray-core.git . && \
  8. bash ./release/user-package.sh nosource noconf codename=docker-fly abpathtgz=/tmp/v2ray.tgz
  9. ############################
  10. # STEP 2 build a small image
  11. ############################
  12. FROM alpine
  13. COPY --from=builder /tmp/v2ray.tgz /tmp
  14. RUN apk update && apk add ca-certificates && \
  15. mkdir -p /usr/bin/v2ray && \
  16. tar xvfz /tmp/v2ray.tgz -C /usr/bin/v2ray
  17. ENTRYPOINT ["/usr/bin/v2ray/v2ray"]