docker secret plugin.
https://docs.docker.com/engine/extend/#debugging-plugins
make clean
make create
make push
install and setup enabled by default:
docker plugin install --grant-all-permissions docker-plugin-secrets:0.0.1
setup token if renew:
docker plugin disable docker-plugin-secrets:1.0.0
docker plugin set docker-plugin-secrets:1.0.0
docker plugin enable docker-plugin-secrets:1.0.0
docker以debug模式启动
{
"debug": true
}
查看log
journalctl -f -u docker.service
cd /run/docker/plugins/$your_plugin_id
cat < init-stdout
cat < init-stderr
use it in compose file
secrets:
haproxy:
driver: docker-plugin-secrets:0.0.1
labels:
docker.plugin.secretprovider.vault.path: canux/data/pki
docker.plugin.secretprovider.vault.field: "*.canuxcheng.com"