我打算在 Argo 工作流程中使用 rclone。运行和挂载配置文件的 docker 命令是:
docker run --rm \
-v $(pwd)/config:/config/rclone \
rclone/rclone \
listremotes
这工作正常。但是,将其$(pwd)/config
装入工作流容器的最佳方法是什么?我有这样的事情:
container:
image: rclone/rclone:latest
args: ["listremotes"]
这给出了:
NOTICE: Config file "/config/rclone/rclone.conf" not found - using defaults
这也可以正常工作,但需要对配置进行硬编码:
(...)
- name: write-message
container:
image: alpine:latest
command: [sh, -c]
args:
[
"echo writting file; echo CONFIG_HERE... | tee /config/rclone/rclone.conf",
]
volumeMounts:
- name: workdir
mountPath: /config/rclone
- name: rclone-listremotes
container:
image: rclone/rclone:latest
args: ["listremotes"]
volumeMounts:
- name: workdir
mountPath: /config/rclone
如何从主机传递配置文件,而不是直接编写配置?
非常感谢!