Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serve/docker: allow to customize proxy settings of docker plugin #5658

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/serve/docker/contrib/plugin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ ENV RCLONE_CACHE_DIR=/data/cache
ENV RCLONE_BASE_DIR=/mnt
ENV RCLONE_VERBOSE=0

ENV HTTP_PROXY=
ENV HTTPS_PROXY=
ENV NO_PROXY=

WORKDIR /data
ENTRYPOINT ["/usr/local/bin/rclone"]
CMD ["serve", "docker"]
15 changes: 15 additions & 0 deletions cmd/serve/docker/contrib/plugin/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@
{
"name": "RCLONE_BASE_DIR",
"value": "/mnt"
},
{
"name": "HTTP_PROXY",
"value": "",
"settable": ["value"]
},
{
"name": "HTTPS_PROXY",
"value": "",
"settable": ["value"]
},
{
"name": "NO_PROXY",
"value": "",
"settable": ["value"]
}
],
"mounts": [
Expand Down
7 changes: 6 additions & 1 deletion docs/content/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ swarm services that use them. This is rather tedious so please carefully
plan in advance.

You can tweak the following settings:
`args`, `config`, `cache`, and `RCLONE_VERBOSE`.
`args`, `config`, `cache`, `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`
and `RCLONE_VERBOSE`.
It's _your_ task to keep plugin settings in sync across swarm cluster nodes.

`args` sets command-line arguments for the `rclone serve docker` command
Expand Down Expand Up @@ -387,6 +388,8 @@ The plugin output by default feeds the docker daemon log on local host.
Log entries are reflected as _errors_ in the docker log but retain their
actual level assigned by rclone in the encapsulated message string.

`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` customize the plugin proxy settings.

You can set custom plugin options right when you install it, _in one go_:
```
docker plugin remove rclone
Expand Down Expand Up @@ -504,6 +507,8 @@ sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docke
```
though this is rarely needed.

## Caveats

Finally I'd like to mention a _caveat with updating volume settings_.
Docker CLI does not have a dedicated command like `docker volume update`.
It may be tempting to invoke `docker volume create` with updated options
Expand Down