File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
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" ]
Original file line number Diff line number Diff line change @@ -35,6 +35,25 @@ systemctl enable x-ui
35
35
systemctl restart x-ui
36
36
```
37
37
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
+
38
57
## 建议系统
39
58
- CentOS 7+
40
59
- Ubuntu 16+
You can’t perform that action at this time.
0 commit comments