Skip to content

Commit 9d76f90

Browse files
committed
Add docker version
1 parent a7d35ba commit 9d76f90

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:latest AS builder
2+
WORKDIR /root
3+
COPY . .
4+
RUN go build main.go
5+
6+
7+
FROM debian:11-slim
8+
RUN apt-get update && apt-get install -y --no-install-recommends -y ca-certificates \
9+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
10+
WORKDIR /root
11+
COPY --from=builder /root/main /root/x-ui
12+
COPY bin/. /root/bin/.
13+
VOLUME [ "/etc/x-ui" ]
14+
CMD [ "./x-ui" ]

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ systemctl enable x-ui
3535
systemctl restart x-ui
3636
```
3737

38+
## 使用docker安装
39+
1. 安装docker
40+
```shell
41+
curl -fsSL https://get.docker.com | sh
42+
```
43+
2. 安装x-ui
44+
```shell
45+
mkdir x-ui && cd x-ui
46+
docker run -itd --network=host \
47+
-v $PWD/db/:/etc/x-ui/ \
48+
-v $PWD/cert/:/root/cert/ \
49+
--name x-ui --restart=unless-stopped \
50+
enwaiax/x-ui:latest
51+
```
52+
>Build 自己的镜像
53+
```shell
54+
docker build -t x-ui .
55+
```
56+
3857
## 建议系统
3958
- CentOS 7+
4059
- Ubuntu 16+

0 commit comments

Comments
 (0)