I use docker compose to remote deploy services (image on private registry) to a server.
docker --host xxxx rcompose up -d
with
docker-compose.yml
name: projet_x
service_a:
image: myregistry/myimage:1.0.0
volumes:
- <path on remote computer>:<path in container>
....
service_b:
....
If I need to deploy the version 2.0.0 of the image from an other computer (by somebody else or because I change computer) so I should get the docker-compose.yml and do a
docker --host xxxx rcompose up -d
and docker should use the project name to retreive the service_a and update it, or did I miss something ?
What is the rcompose command you’re using? At first I thought it was a typo, but you made it twice, so just verifying if you’re actually talking about compose and not some custom tool
As for your question, if you edit the compose file to change the image (or version), yes, up -d will recreate the container from the new image
If I do it on the computer on which I initialy run the compose up, yes.
But if I copy the compose yml file to antoher computer It will not work (the link between the compose project and the container is lost).
As I understand the name: shool take care of the container identification (project name + service/container name).
Silly me it was a docker desktop version difference between the 2 computer. Yhey have change their way to identify the containers between the two versions.
I thought I had updates the older one but it seems not.
So it works as intended, the name: attribute is working (locally and remotely) to identify the containers from the config.