-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (27 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM alpine:3.22.4 as builder
# Set arguments for configuration
ARG SOCKS_VERSION=${SOCKS_VERSION:-v1.24.0}
# Install dependencies
RUN apk add --no-cache tar xz wget ca-certificates && update-ca-certificates
RUN echo "Downloading shadowsocks-rust version: ${SOCKS_VERSION}"
# Download and install SOCKS
RUN wget https://github.com/shadowsocks/shadowsocks-rust/releases/download/${SOCKS_VERSION}/shadowsocks-${SOCKS_VERSION}.x86_64-unknown-linux-musl.tar.xz && \
tar -xvf shadowsocks-${SOCKS_VERSION}.x86_64-unknown-linux-musl.tar.xz
# Runtime stage
FROM alpine:3.22.4 as runtime
RUN apk add --no-cache ca-certificates && update-ca-certificates
ARG SOCKS_VERSION=${SOCKS_VERSION:-v1.24.0}
# Set environment variables for configuration
ENV SOCKS_MODE=server
ENV SOCKS_VERSION=${SOCKS_VERSION}
# Copy Shadowsocks binaries from builder
COPY --from=builder /ssserver /usr/local/bin/ssserver
COPY --from=builder /ssmanager /usr/local/bin/ssmanager
COPY --from=builder /sslocal /usr/local/bin/sslocal
# Config directory (mountable as volume)
VOLUME /config
WORKDIR /config
# Entrypoint script
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]