Firstly every step is done seemingly successfully (not any error reported). But per what I understand about how to check if the new config is applied OK, it seems to be failed updating the config.
Suppose I have a config file with a simple content like this:
I created a config (the first version) like this:
echo 'Well done' | docker config create my-config -
Now I have a local file named
my-config.txt (on the host machine) with content as described above, it’s used as a template (source) to clone over the target on the docker container. On the docker container, there is already a config file with the same content (originally). Now I change the content of the file
my-config.txt (on the host machine) to something like this:
Well done !!!
And next I update the current docker service (created before) by using
docker service update to apply the new config file, like this:
//firstly create another version of config docker config create my-config-2 /home/my_user/my-config.txt docker service update \ --config-add source=my-config-2,target=my-config.txt \ --config-rm my-config \ my-service
As I said, it seems to execute successfully. But when I try opening the
my-config.txt file on the docker container, its content is kept unchanged, like this:
docker exec [container_id] cat my-config.txt
It still shows
Well done whereas the expected content should be
Well done !!! . Isn’t that what it should be? Could you point out something wrong to me here? Or could you suggest something helpful to diagnose this issue or even go straight the right way (different from what I’ve done) without having to trying to solve this issue. Thanks!
My environment info:
- Host machine: Ubuntu 18.10
- Docker latest version
p/s: Actually this has been exactly copied (ported) from the question I asked in SO, but no one has had an idea or suggestion yet. I hope the situation will be different in here.