docker-compose keeps using old image content

后端 未结 3 637
滥情空心
滥情空心 2021-02-08 06:24

We use our gitlab-ci to build fresh images with the latest version of our code. These images are day to day built with the latest tag. We tag images during the rele

相关标签:
3条回答
  • 2021-02-08 07:14

    The process should be:

    docker-compose pull
    docker-compose up
    

    If you have volumes, then those will be persistent by design. If you need your volumes to not be persistent, then you may want to reconsider having that data inside a volume, or you'll need to reset the volume on every redeploy with a docker-compose down -v to remove the containers and the volumes.

    If you still have issues with this, make sure your install of docker and docker-compose are current.

    0 讨论(0)
  • 2021-02-08 07:17

    According to the documentation, you can ignore data from previous volume with this:

    docker-compose up -d --force-recreate --renew-anon-volumes

    See https://docs.docker.com/compose/reference/up/

    0 讨论(0)
  • 2021-02-08 07:22

    I just had this problem in dev too. docker-compose up uses an old image even though I have built the latest image. And if I manually run docker run in latest image I can see the new changes. What fixed for me is running:

    docker-compose up --build <your-service>.

    Hope it helps!

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