-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
27 lines (21 loc) · 798 Bytes
/
Dockerfile
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
FROM golang:1.18 AS builder
LABEL maintainer="mingcheng<mingcheng@outook.com>"
ENV PACKAGE github.com/mingcheng/socks5lb
ENV GOPROXY https://goproxy.cn,direct
ENV BUILD_DIR ${GOPATH}/src/${PACKAGE}
# Build
COPY . ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN make build && mv ./socks5lb /usr/bin/socks5lb
# Stage2
FROM debian:bullseye
ENV TZ "Asia/Shanghai"
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apt -y update \
&& apt -y upgrade \
&& apt -y install ca-certificates openssl tzdata curl dumb-init \
&& apt -y autoremove
COPY --from=builder /usr/bin/socks5lb /bin/socks5lb
ENTRYPOINT ["dumb-init", "/bin/socks5lb"]