diff --git a/Docker_EN/Dockerfile b/Docker_EN/Dockerfile new file mode 100644 index 0000000000..2ae6581e8b --- /dev/null +++ b/Docker_EN/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:11-slim +WORKDIR /root +COPY en.sh /root/en.sh +RUN apt-get update && apt-get install -y --no-install-recommends -y systemctl curl bash v2ray gzip wget ca-certificates \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN systemctl start v2ray +RUN bash /root/en.sh +WORKDIR /root + + +VOLUME [ "/etc/x-ui" ] +CMD [ "/root/x-ui/x-ui" ] \ No newline at end of file diff --git a/Docker_EN/en.sh b/Docker_EN/en.sh new file mode 100644 index 0000000000..e5cef2cf09 --- /dev/null +++ b/Docker_EN/en.sh @@ -0,0 +1,47 @@ +#!/bin/bash +red='\033[0;31m' +green='\033[0;32m' +yellow='\033[0;33m' +plain='\033[0m' + +cur_dir=$(pwd) + + arch=$(arch) + last_version=${last_version} + +if [[ $arch == "x86_64" || $arch == "x64" || $arch == "amd64" ]]; then + arch="amd64" +elif [[ $arch == "aarch64" || $arch == "arm64" ]]; then + arch="arm64" +else + arch="amd64" + echo -e "${red}fail to check system arch,will use default arch here: ${arch}${plain}" +fi + + if [ $# == 0 ]; then + last_version=$(curl -Ls "https://api.github.com/repos/FranzKafkaYu/x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + if [[ ! -n "$last_version" ]]; then + echo -e "${red}refresh x-ui version failed,it may due to Github API restriction,please try it later${plain}" + exit 1 + fi + echo -e "get x-ui latest version succeed:${last_version},begin to install..." + wget -N --no-check-certificate -O /root/x-ui-linux-${arch}-english.tar.gz https://github.com/FranzKafkaYu/x-ui/releases/download/${last_version}/x-ui-linux-${arch}-english.tar.gz + if [[ $? -ne 0 ]]; then + echo -e "${red}dowanload x-ui failed,please be sure that your server can access Github{plain}" + exit 1 + fi + else + last_version=$1 + url="https://github.com/FranzKafkaYu/x-ui/releases/download/${last_version}/x-ui-linux-${arch}-english.tar.gz" + echo -e "begin to install x-ui v$1 ..." + wget -N --no-check-certificate -O /root/x-ui-linux-${arch}-english.tar.gz ${url} + if [[ $? -ne 0 ]]; then + echo -e "${red}dowanload x-ui v$1 failed,please check the verison exists${plain}" + exit 1 + fi + fi + + + tar zxvf x-ui-linux-${arch}-english.tar.gz + rm x-ui-linux-${arch}-english.tar.gz -f + \ No newline at end of file diff --git a/Docker_EN/install.sh b/Docker_EN/install.sh new file mode 100644 index 0000000000..8aa1b9a425 --- /dev/null +++ b/Docker_EN/install.sh @@ -0,0 +1,6 @@ +docker build -t xui:latest . +docker run -itd --network=host \ + -v $PWD/db/:/etc/x-ui/ \ + -v $PWD/cert/:/root/cert/ \ + --name x-ui --restart=unless-stopped \ + xui:latest