how to get docker-compose to use the latest image from repository

后端 未结 10 1387
栀梦
栀梦 2021-01-30 07:51

I don\'t know what I\'m doing wrong, but I simply cannot get docker-compose up to use the latest image from our registry without first removing the old containers f

10条回答
  •  情话喂你
    2021-01-30 08:38

    To close this question, what seemed to have worked is indeed running

    docker-compose stop
    docker-compose rm -f
    docker-compose -f docker-compose.yml up -d
    

    I.e. remove the containers before running up again.

    What one needs to keep in mind when doing it like this is that data volume containers are removed as well if you just run rm -f. In order to prevent that I specify explicitly each container to remove:

    docker-compose rm -f application nginx php
    

    As I said in my question, I don't know if this is the correct process. But this seems to work for our use case, so until we find a better solution we'll roll with this one.

提交回复
热议问题