DOCKER CONFIG CREATE
Commande : docker config create
Usage: docker config create [OPTIONS] CONFIG file|- Create a config from a file or STDIN Options: -l, --label list Config labels --template-driver string Template driver
Créer une nouvelle config
echo config | docker config create config_name -
Les configs générées sont accessibles à l’intérieur des containers à la racine du système de fichiers dans un répertoire portant le nom de la config.
ex :
$ echo "This is a config" | docker config create my-config - rpzlw2xdnm20zgle5axc499jl $ docker config ls ID NAME CREATED UPDATED rpzlw2xdnm20zgle5axc499jl my-config 15 seconds ago 15 seconds ago $ docker service create --name redis --config=my-config redis:3.0.6
Sur le container en cours d’exécution, on peut accéder aux configs en clair :
# cat /my-config
This is a config