FROM alpine:latest
#FROM m.daocloud.io/docker.io/library/alpine:latest

ENV TZ=Asia/Shanghai DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
RUN echo "https://mirrors.ustc.edu.cn/alpine/latest-stable/main/" > /etc/apk/repositories \
    && apk add --no-cache libstdc++ libintl tzdata zeromq bash net-tools iproute2 numactl-dev iputils iptables dmidecode \
    && ln -snf /usr/share/zoneinfo/$clTZ /etc/localtime \
    && echo $TZ > /etc/timezone


EXPOSE 1802/tcp
EXPOSE 1802/udp
EXPOSE 1803/tcp
EXPOSE 1803/udp
EXPOSE 1804/tcp
EXPOSE 1804/udp

WORKDIR /app
COPY . .

RUN mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun

ENV SNLTTY_LINKER_IS_DOCKER="linker"
ENV DOTNET_ThreadPool_UnfairSemaphoreSpinLimit=0

ENTRYPOINT ["./linker"]