How to automatically update your docker containers, if base-images are updated

后端 未结 16 774
别那么骄傲
别那么骄傲 2020-12-04 04:17

Say I have a trivial container based on the ubuntu:latest. Now there is a security update and ubuntu:latest is updated in the docker repo .

16条回答
  •  广开言路
    2020-12-04 05:05

    You would not know your container is behind without running docker pull. Then you'd need to rebuild or recompose your image.

    docker pull image:tag
    docker-compose -f docker-compose.yml -f production.yml up -d --build
    

    The commands can be put in a script along with anything else necessary to complete the upgrade, although a proper container would not need anything additional.

提交回复
热议问题