# 將主機上的目錄綁定給LXC容器中的docker

## 之前將docker裝進lxc中，我們一樣可以綁定host機的目錄給lxc中的docker中

```
mkdir /zfs/lxc-docker
chown 100000:100000 /zfs/lxc-docekr
pct set 102 -mp0 /zfs/lxc-docker,mp=/var/lib/docker
```

### 安裝portainer

```
docker volume create portainer
docker run -d --privileged --name portainer -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart=always -v portainer:/data portainer/portainer
```

![](/files/-LqyffKjEE0FegIJUUSD)

<https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/>

```
docker run -d --name nfs --net=host --privileged -v NFS:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/pomoxve/jiang-zhu-ji-shang-de-mu-lu-bang-ding-gei-lxc-rong-qi-zhong-de-docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
