由于研究tls分流器+v2ray+trojan的docker版,老是不能识别trojan流量
发现在dockerhub的tls-shunt-proxy只有一个但是版本太低了,还好这个大神有贴出他的Dockerfile
# Dockerfile for tls-shunt-proxy based alpine
# Copyright (C) 2019 - 2020 namowens
# Reference URL:
# https://github.com/liberal-boy/tls-shunt-proxy
# STEP 1 build executable binary
FROM golang:alpine AS builder #builder是别名
RUN apk update && apk add --no-cache git
WORKDIR /go/src/tls-shunt-proxy
RUN git clone --progress https://github.com/liberal-boy/tls-shunt-proxy.git . && \
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -tags "full" -ldflags "-s -w" -o /tmp/tsp && \
chmod +x /tmp/tsp
# STEP 2 build a small image
FROM alpine
LABEL maintainer="namowens <[email protected]>"
LABEL version="0.5.3"
#从上一个from里复制
COPY --from=builder /tmp/tsp /usr/bin/tls-shunt-proxy/tls-shunt-proxy
COPY config.yaml /etc/tls-shunt-proxy/config.yaml
#把执行文件添加到Path里
ENV PATH /usr/bin/tls-shunt-proxy:$PATH
WORKDIR /etc/ssl/tls-shunt-proxy
CMD ["tls-shunt-proxy", "-config", "/etc/tls-shunt-proxy/config.yaml"]
修改下就可以变成自己的
# Dockerfile for tls-shunt-proxy based alpine
# Copyright (C) 2019 - 2020 namowens
# Reference URL:
# https://github.com/liberal-boy/tls-shunt-proxy
# STEP 1 build executable binary
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git
WORKDIR /go/src/tls-shunt-proxy
RUN git clone --progress https://github.com/liberal-boy/tls-shunt-proxy.git . && \
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -tags "full" -ldflags "-s -w" -o /tmp/tsp && \
chmod +x /tmp/tsp
# STEP 2 build a small image
FROM alpine
LABEL maintainer="hqhyco <[email protected]>"
LABEL version="0.6.0"
COPY --from=builder /tmp/tsp /usr/bin/tls-shunt-proxy/tls-shunt-proxy
COPY config.yaml /etc/tls-shunt-proxy/config.yaml
ENV PATH /usr/bin/tls-shunt-proxy:$PATH
WORKDIR /etc/ssl/tls-shunt-proxy
CMD ["tls-shunt-proxy", "-config", "/etc/tls-shunt-proxy/config.yaml"]
可以看到第一个From是编译用的,安装了git
git下了tls-shunt-proxy的源码,然后GO编译
以后也可以用这个模板来制作其他在github上看到的源码