Dockerfile 915 B

12345678910111213141516171819202122232425
  1. # Dockerfile for xray based alpine
  2. # Copyright (C) 2019 - 2025 Teddysun <[email protected]>
  3. # Reference URL:
  4. # https://github.com/XTLS/Xray-core
  5. # https://github.com/v2fly/v2ray-core
  6. # https://github.com/Loyalsoldier/v2ray-rules-dat
  7. FROM alpine:latest
  8. LABEL maintainer="Teddysun <[email protected]>"
  9. WORKDIR /root
  10. COPY xray.sh /root/xray.sh
  11. COPY config.json /etc/xray/config.json
  12. RUN set -ex \
  13. && apk add --no-cache bash tzdata ca-certificates openssl \
  14. && mkdir -p /var/log/xray /usr/share/xray \
  15. && chmod +x /root/xray.sh \
  16. && /root/xray.sh \
  17. && rm -fv /root/xray.sh \
  18. && wget -O /usr/share/xray/geosite.dat https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat \
  19. && wget -O /usr/share/xray/geoip.dat https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat
  20. VOLUME /etc/xray
  21. ENV TZ=Asia/Shanghai
  22. CMD [ "/usr/bin/xray", "-config", "/etc/xray/config.json" ]