Skip to content

Commit

Permalink
Merge pull request vaxilu#138 from Chasing66/main
Browse files Browse the repository at this point in the history
Add docker version
  • Loading branch information
vaxilu authored Dec 5, 2021
2 parents a7d35ba + 9d76f90 commit fe61444
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:latest AS builder
WORKDIR /root
COPY . .
RUN go build main.go


FROM debian:11-slim
RUN apt-get update && apt-get install -y --no-install-recommends -y ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /root
COPY --from=builder /root/main /root/x-ui
COPY bin/. /root/bin/.
VOLUME [ "/etc/x-ui" ]
CMD [ "./x-ui" ]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ systemctl enable x-ui
systemctl restart x-ui
```

## 使用docker安装
1. 安装docker
```shell
curl -fsSL https://get.docker.com | sh
```
2. 安装x-ui
```shell
mkdir x-ui && cd x-ui
docker run -itd --network=host \
-v $PWD/db/:/etc/x-ui/ \
-v $PWD/cert/:/root/cert/ \
--name x-ui --restart=unless-stopped \
enwaiax/x-ui:latest
```
>Build 自己的镜像
```shell
docker build -t x-ui .
```

## 建议系统
- CentOS 7+
- Ubuntu 16+
Expand Down

0 comments on commit fe61444

Please sign in to comment.