docs: replace sshfs with rclone
Signed-off-by: aevesdocker <allie.sadler@docker.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c528504434
commit
b501283743
@ -35,31 +35,38 @@ Plugins that start successfully are listed as enabled in the output.
|
|||||||
After a plugin is installed, you can use it as an option for another Docker
|
After a plugin is installed, you can use it as an option for another Docker
|
||||||
operation, such as creating a volume.
|
operation, such as creating a volume.
|
||||||
|
|
||||||
In the following example, you install the `sshfs` plugin, verify that it is
|
In the following example, you install the [`rclone` plugin](https://rclone.org/docker/), verify that it is
|
||||||
enabled, and use it to create a volume.
|
enabled, and use it to create a volume.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> This example is intended for instructional purposes only. Once the volume is
|
> This example is intended for instructional purposes only.
|
||||||
> created, your SSH password to the remote host is exposed as plaintext when
|
|
||||||
> inspecting the volume. Delete the volume as soon as you are done with the
|
|
||||||
> example.
|
|
||||||
|
|
||||||
1. Install the `sshfs` plugin.
|
1. Set up the pre-requisite directories. By default they must exist on the host at the following locations:
|
||||||
|
|
||||||
|
- `/var/lib/docker-plugins/rclone/config`. Reserved for the `rclone.conf` config file and must exist even if it's empty and the config file is not present.
|
||||||
|
- `/var/lib/docker-plugins/rclone/cache`. Holds the plugin state file as well as optional VFS caches.
|
||||||
|
|
||||||
|
2. Install the `rclone` plugin.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker plugin install vieux/sshfs
|
$ docker plugin install rclone/docker-volume-rclone --alias rclone
|
||||||
|
|
||||||
Plugin "vieux/sshfs" is requesting the following privileges:
|
Plugin "rclone/docker-volume-rclone" is requesting the following privileges:
|
||||||
- network: [host]
|
- network: [host]
|
||||||
- capabilities: [CAP_SYS_ADMIN]
|
- mount: [/var/lib/docker-plugins/rclone/config]
|
||||||
Do you grant the above permissions? [y/N] y
|
- mount: [/var/lib/docker-plugins/rclone/cache]
|
||||||
|
- device: [/dev/fuse]
|
||||||
vieux/sshfs
|
- capabilities: [CAP_SYS_ADMIN]
|
||||||
|
Do you grant the above permissions? [y/N]
|
||||||
```
|
```
|
||||||
|
|
||||||
The plugin requests 2 privileges:
|
The plugin requests 5 privileges:
|
||||||
|
|
||||||
- It needs access to the `host` network.
|
- It needs access to the `host` network.
|
||||||
|
- Access to pre-requisite directories to mount to store:
|
||||||
|
- Your Rclone config files
|
||||||
|
- Temporary cache data
|
||||||
|
- Gives access to the FUSE (Filesystem in Userspace) device. This is required because Rclone uses FUSE to mount remote storage as if it were a local filesystem.
|
||||||
- It needs the `CAP_SYS_ADMIN` capability, which allows the plugin to run
|
- It needs the `CAP_SYS_ADMIN` capability, which allows the plugin to run
|
||||||
the `mount` command.
|
the `mount` command.
|
||||||
|
|
||||||
@ -68,24 +75,25 @@ enabled, and use it to create a volume.
|
|||||||
```console
|
```console
|
||||||
$ docker plugin ls
|
$ docker plugin ls
|
||||||
|
|
||||||
ID NAME TAG DESCRIPTION ENABLED
|
ID NAME DESCRIPTION ENABLED
|
||||||
69553ca1d789 vieux/sshfs latest the `sshfs` plugin true
|
aede66158353 rclone:latest Rclone volume plugin for Docker true
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Create a volume using the plugin.
|
3. Create a volume using the plugin.
|
||||||
This example mounts the `/remote` directory on host `1.2.3.4` into a
|
This example mounts the `/remote` directory on host `1.2.3.4` into a
|
||||||
volume named `sshvolume`.
|
volume named `rclonevolume`.
|
||||||
|
|
||||||
This volume can now be mounted into containers.
|
This volume can now be mounted into containers.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker volume create \
|
$ docker volume create \
|
||||||
-d vieux/sshfs \
|
-d rclone \
|
||||||
--name sshvolume \
|
--name rclonevolume \
|
||||||
-o sshcmd=user@1.2.3.4:/remote \
|
-o type=sftp \
|
||||||
-o password=$(cat file_containing_password_for_remote_host)
|
-o path=remote \
|
||||||
|
-o sftp-host=1.2.3.4 \
|
||||||
sshvolume
|
-o sftp-user=user \
|
||||||
|
-o "sftp-password=$(cat file_containing_password_for_remote_host)"
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Verify that the volume was created successfully.
|
4. Verify that the volume was created successfully.
|
||||||
@ -94,21 +102,21 @@ enabled, and use it to create a volume.
|
|||||||
$ docker volume ls
|
$ docker volume ls
|
||||||
|
|
||||||
DRIVER NAME
|
DRIVER NAME
|
||||||
vieux/sshfs sshvolume
|
rclone rclonevolume
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Start a container that uses the volume `sshvolume`.
|
5. Start a container that uses the volume `rclonevolume`.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run --rm -v sshvolume:/data busybox ls /data
|
$ docker run --rm -v rclonevolume:/data busybox ls /data
|
||||||
|
|
||||||
<content of /remote on machine 1.2.3.4>
|
<content of /remote on machine 1.2.3.4>
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Remove the volume `sshvolume`
|
6. Remove the volume `rclonevolume`
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker volume rm sshvolume
|
$ docker volume rm rclonevolume
|
||||||
|
|
||||||
sshvolume
|
sshvolume
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user