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

后端 未结 10 1388
栀梦
栀梦 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

    The docker-compose documentation for the 'up' command clearly states that it updates the container should the image be changed since the last 'up' was performed:

    If there are existing containers for a service, and the service’s configuration or image was changed after the container’s creation, docker-compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes).

    So by using 'stop' followed by 'pull' and then 'up' this should therefore avoid issues of lost volumes for the running containers, except of course, for containers whose images have been updated.

    I am currently experimenting with this process and will include my results in this comment shortly.

提交回复
热议问题