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

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

    But

    https://docs.docker.com/compose/reference/up/ -quiet-pull Pull without printing progress information

    docker-compose up --quiet-pull
    

    not work ?

    0 讨论(0)
  • 2021-01-30 08:39

    in order to make sure, that you are using the latest version for your :latest tag from your registry (e.g. docker hub) you need to also pull the latest tag again. in case it changed, the diff will be downloaded and started when you docker-compose up again.

    so this would be the way to go:

    docker-compose stop
    docker-compose rm -f
    docker-compose pull   
    docker-compose up -d
    

    i glued this into an image that i run to start docker-compose and make sure images stay up-to-date: https://hub.docker.com/r/stephanlindauer/docker-compose-updater/

    0 讨论(0)
  • 2021-01-30 08:41

    If the docker compose configuration is in a file, simply run:

    docker-compose -f appName.yml down && docker-compose -f appName.yml pull && docker-compose -f appName.yml up -d
    
    0 讨论(0)
  • 2021-01-30 08:42

    I've seen this occur in our 7-8 docker production system. Another solution that worked for me in production was to run

    docker-compose down
    docker-compose up -d
    

    this removes the containers and seems to make 'up' create new ones from the latest image.

    This doesn't yet solve my dream of down+up per EACH changed container (serially, less down time), but it works to force 'up' to update the containers.

    0 讨论(0)
提交回复
热议问题