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

后端 未结 16 686
别那么骄傲
别那么骄傲 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:11

    I'm not going into the whole question of whether or not you want unattended updates in production (I think not). I'm just leaving this here for reference in case anybody finds it useful. Update all your docker images to the latest version with the following command in your terminal:

    # docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -L1 docker pull

提交回复
热议问题