This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
forked from vaxilu/x-ui
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
add docker file En version #184
Open
samsesh
wants to merge
2
commits into
FranzKafkaYu:main
Choose a base branch
from
samsesh:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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..." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from:
to:
|
||
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}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct spelling and grammar.
to:
|
||
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}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
from:
to:
|
||
exit 1 | ||
fi | ||
fi | ||
|
||
|
||
tar zxvf x-ui-linux-${arch}-english.tar.gz | ||
rm x-ui-linux-${arch}-english.tar.gz -f | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correcting grammar: