Skip to content

Commit

Permalink
更新文档,docker 增加国内镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojun1998 committed Sep 30, 2024
1 parent 05d7823 commit ec7ea21
Show file tree
Hide file tree
Showing 2 changed files with 298 additions and 10 deletions.
158 changes: 152 additions & 6 deletions docs/install/os-docker.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Docker & Docker Compose

## Docker

### 安装介绍

Docker 镜像托管在 DockerHub:https://hub.docker.com/r/zhaojun1998/zfile
Docker 镜像托管在 DockerHub:https://hub.docker.com/r/zhaojun1998/zfile, 如果你的网络环境访问 docker hub 不方便,还可以使用镜像:

- 香港:swr.ap-southeast-1.myhuaweicloud.com/zfile-dev/zfile:latest
- 北京: swr.cn-north-1.myhuaweicloud.com/zfile-dev/zfile:latest

:::tip 配置说明

Expand All @@ -15,15 +21,46 @@ Docker 镜像托管在 DockerHub:https://hub.docker.com/r/zhaojun1998/zfile

:::

<Tabs>
<TabItem value="dockerhub" label="DockerHub">

```bash showLineNumbers {2,5}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
zhaojun1998/zfile:latest
```

</TabItem>
<TabItem value="swr-bj" label="北京镜像">

```bash showLineNumbers {2,5}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
swr.cn-north-1.myhuaweicloud.com/zfile-dev/zfile:latest
```

</TabItem>
<TabItem value="swr-hk" label="香港镜像">

```bash showLineNumbers {2,5}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
zhaojun1998/zfile
swr.ap-southeast-1.myhuaweicloud.com/zfile-dev/zfile:latest
```

</TabItem>
</Tabs>


### 配置文件映射 {#config}

**如需映射配置文件**则需要先在宿主机下载配置文件,然后映射到容器内:
Expand All @@ -37,16 +74,46 @@ curl -k -o /root/application.properties https://c.jun6.net/ZFILE/application.pro

> 提示: 启动容器后无法修改文件映射,需先 `docker rm -f zfile` 删除容器,再重新运行命令.

<Tabs>
<TabItem value="dockerhub" label="DockerHub">
```bash showLineNumbers {6}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
-v /root/application.properties:/root/application.properties \
zhaojun1998/zfile
zhaojun1998/zfile:latest
```

</TabItem>

<TabItem value="swr-bj" label="北京镜像">
```bash showLineNumbers {6}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
-v /root/application.properties:/root/application.properties \
swr.cn-north-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>

<TabItem value="swr-hk" label="香港镜像">
```bash showLineNumbers {6}
docker run -d --name=zfile --restart=always \
-p 8080:8080 \
-v /root/zfile/db:/root/.zfile-v4/db \
-v /root/zfile/logs:/root/.zfile-v4/logs \
-v /root/zfile/file:/data/file \
-v /root/application.properties:/root/application.properties \
swr.ap-southeast-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>
</Tabs>

---

## Docker Compose

Expand All @@ -61,6 +128,43 @@ docker run -d --name=zfile --restart=always \

:::

<Tabs>
<TabItem value="dockerhub" label="DockerHub">
```yml showLineNumbers {7,11}
version: '3.3'
services:
zfile:
container_name: zfile
restart: always
ports:
- '8080:8080'
volumes:
- '/root/zfile/db:/root/.zfile-v4/db'
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
image: zhaojun1998/zfile:latest
```
</TabItem>
<TabItem value="swr-bj" label="北京镜像">
```yml showLineNumbers {7,11}
version: '3.3'
services:
zfile:
container_name: zfile
restart: always
ports:
- '8080:8080'
volumes:
- '/root/zfile/db:/root/.zfile-v4/db'
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
image: swr.cn-north-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>
<TabItem value="swr-hk" label="香港镜像">
```yml showLineNumbers {7,11}
version: '3.3'
services:
Expand All @@ -73,9 +177,11 @@ services:
- '/root/zfile/db:/root/.zfile-v4/db'
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
image: zhaojun1998/zfile
image: swr.ap-southeast-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>
</Tabs>
### 配置文件映射 {#config2}
Expand All @@ -91,6 +197,25 @@ curl -k -o /root/application.properties https://c.jun6.net/ZFILE/application.pro

> 提示: 启动容器后无法修改文件映射,需先 `docker rm -f zfile` 删除容器,再重新运行命令.

<Tabs>
<TabItem value="dockerhub" label="DockerHub">
```yml showLineNumbers {12}
version: '3.3'
services:
zfile:
container_name: zfile
restart: always
ports:
- '8080:8080'
volumes:
- '/root/zfile/db:/root/.zfile-v4/db'
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
- '/root/application.properties:/root/application.properties'
image: zhaojun1998/zfile:latest
```
</TabItem>
<TabItem value="swr-bj" label="北京镜像">
```yml showLineNumbers {12}
version: '3.3'
services:
Expand All @@ -104,8 +229,29 @@ services:
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
- '/root/application.properties:/root/application.properties'
image: zhaojun1998/zfile
image: swr.cn-north-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>
<TabItem value="swr-hk" label="香港镜像">
```yml showLineNumbers {12}
version: '3.3'
services:
zfile:
container_name: zfile
restart: always
ports:
- '8080:8080'
volumes:
- '/root/zfile/db:/root/.zfile-v4/db'
- '/root/zfile/logs:/root/.zfile-v4/logs'
- '/root/zfile/file:/data/file'
- '/root/application.properties:/root/application.properties'
image: swr.ap-southeast-1.myhuaweicloud.com/zfile-dev/zfile:latest
```
</TabItem>
</Tabs>



-----

Expand Down
Loading

0 comments on commit ec7ea21

Please sign in to comment.