-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.obfs4
More file actions
21 lines (18 loc) · 790 Bytes
/
Dockerfile.obfs4
File metadata and controls
21 lines (18 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Build the obfs4 binary (cross-compiling)
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as obfs-builder
ARG OBFS_VERSION="obfs4proxy-0.0.14-tor2"
RUN apk add --update --no-cache git && \
git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird.git --depth 1 --branch "${OBFS_VERSION}" /obfs
# Build obfs
RUN mkdir /out
WORKDIR /obfs
ARG TARGETOS TARGETARCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/obfs4proxy ./obfs4proxy && \
echo 'user:x:1001:1001:user:/:' > /tmp/passwd
FROM scratch
USER 1001
COPY --from=obfs-builder /tmp/passwd /etc/passwd
COPY --from=obfs-builder /out/obfs4proxy /
ENTRYPOINT ["/obfs4proxy"]