Docker updating image along when dockerfile changes

前端 未结 3 1457
执笔经年
执笔经年 2021-01-31 00:59

I\'m playing with docker by creating a Dockerfile with some nodejs instructions. Right now, every time I make changes to the dockerfile I recreate the image by runn

3条回答
  •  鱼传尺愫
    2021-01-31 01:44

    Docker build support caching as long as there is no ADD instruction. If you are actively developing and changing files, only what is after the ADD will be rebuilt.

    Since 0.6.2 (scheduled today), you can do docker build --rm . and it will remove the temporary containers. It will keep the images though.

    In order to remove the orphan images, you can check them out with docker images, and perform a docker rmi on one of them. As of now, there is an auto-prune and all untagged images (orphans, previous builds) will be removed.

提交回复
热议问题