未验证 提交 2ec2badf 编写于 作者: R Rui Su 提交者: GitHub

add ToC in Docker doc (#848)

* add ToC for Docker English doc

* fix error link in ToC

* add ToC in Docker Chinese doc
上级 737585b3
......@@ -2,6 +2,11 @@
There are three ways to use JuiceFS on Docker:
## Table of Content
1. [Volume Mapping](#1-Volume-Mapping)
2. [Docker Volume Plugin](#2-Docker-Volume-Plugin)
3. [Mount JuiceFS in a Container](#3-Mount-JuiceFS-in-a-Container)
## 1. Volume Mapping
This method is to map the directories in the JuiceFS mount point to the Docker container. For example, the JuiceFS storage is mounted in the `/mnt/jfs` directory. When creating a container, you can map JuiceFS storage to the Docker container as follows:
......@@ -50,6 +55,8 @@ After the `allow_other` of FUSE is enabled, you need to re-mount the JuiceFS fil
$ juicefs mount -d -o allow_other redis://<your-redis-url>:6379/1 /mnt/jfs
```
🏡 [Back to Top](#Table-of-Content)
## 2. Docker Volume Plugin
We can also use [volume plugin](https://docs.docker.com/engine/extend/) to access JuiceFS.
......@@ -68,6 +75,8 @@ $ docker run -it -v jfsvolume:/opt busybox ls /opt
Replace above `{{VOLUME_NAME}}`, `{{META_URL}}`, `{{ACCESS_KEY}}`, `{{SECRET_KEY}}` to your own volume setting. For more details about JuiceFS volume plugin, refer [juicedata/docker-volume-juicefs](https://github.com/juicedata/docker-volume-juicefs) repository.
🏡 [Back to Top](#Table-of-Content)
## 3. Mount JuiceFS in a Container
This method is to mount and use the JuiceFS storage directly in the Docker container. Compared with the first method, directly mounting JuiceFS in the container can reduce the chance of file misoperation. It also makes container management clearer and more intuitive.
......@@ -101,3 +110,4 @@ $ sudo docker run -d --name nginx \
nginx-with-jfs
```
🏡 [Back to Top](#Table-of-Content)
......@@ -2,6 +2,11 @@
目前有三种在 Docker 上使用 JuiceFS 存储的方法:
## 目录
1. [卷映射](#1-卷映射)
2. [Docker Volume Plugin](#2-Docker-Volume-Plugin)
3. [在 Docker 容器中挂载 JuiceFS](#3-在-Docker-容器中挂载-JuiceFS)
## 1. 卷映射
这种方法是将 JuiceFS 挂载点中的目录映射给 Docker 容器。比如, JuiceFS 文件系统挂载在 `/mnt/jfs` 目录,在创建容器时可以这样将 JuiceFS 存储映射到 Docker 容器:
......@@ -50,6 +55,8 @@ FUSE 的 `user_allow_other` 启用后,你需要重新挂载 JuiceFS 文件系
$ juicefs mount -d -o allow_other redis://<your-redis-url>:6379/1 /mnt/jfs
```
🏡 [返回 目录](#目录)
## 2. Docker Volume Plugin
JuiceFS 也支持使用 [volume plugin](https://docs.docker.com/engine/extend/) 方式访问。
......@@ -68,6 +75,8 @@ $ docker run -it -v jfsvolume:/opt busybox ls /opt
将上面 `{{VOLUME_NAME}}``{{META_URL}}``{{ACCESS_KEY}}``{{SECRET_KEY}}` 替换成你自己的文件系统配置。想要了解更多 JuiceFS 卷插件内容,可以访问 [juicedata/docker-volume-juicefs](https://github.com/juicedata/docker-volume-juicefs) 代码仓库。
🏡 [返回 目录](#目录)
## 3. 在 Docker 容器中挂载 JuiceFS
这种方法是将 JuiceFS 文件系统直接在 Docker 容器中进行挂载和使用,相比第一种方式,在容器中直接挂载 JuiceFS 可以缩小文件被误操作的几率。谁使用谁挂载,也让容器管理更清晰直观。
......@@ -100,3 +109,5 @@ $ sudo docker run -d --name nginx \
--privileged=true \
nginx-with-jfs
```
🏡 [返回 目录](#目录)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册