mystikos icon indicating copy to clipboard operation
mystikos copied to clipboard

Remove docker images after creation of appdir

Open stdevMac opened this issue 3 years ago • 4 comments

When building an app using myst-appbuilder left one docker image built in the disk, in small environments like mine, I can't store 2 big images.

It will be cool, if it doesn't exist, to have one flag for deleting the generated images using this command if don't need it.

stdevMac avatar Dec 07 '21 18:12 stdevMac

Thanks for the suggestion. We keep the docker images in cache to speed up the next execution of appbuilder. But I agree a flag to remove the image is useful.

jxyang avatar Dec 15 '21 23:12 jxyang

the problem is we dont always know what dependencies are going to be pulled down, and what is used by this current run or from some other docker usage on the machine. What if multiple things are using docker at the same time? It would be dangerous to delete used docker images. It is best to just go ahead and periodically purge all docker images from your machine. Something we should try and do it have all our docker images use the same base OS versions so we dont pull down 5 different versions of Alpine linux!

paulcallen avatar Jan 03 '22 21:01 paulcallen

In my case, I suggest the feature because, in the testing process, I build like 1 image per hour at least, and a very small hard drive (in a vps), and images at least the first image(I use multi-stage builds), is big, so I need to delete each image every time I a going to run a test.

If we delete the docker images that we create in the process of myst-appbuild, in cases like mine will be useful, and I think would not cause so much trouble, at the end isn't the default, just a feature that I can use and probably someone that build big images in small environments will appreciate

stdevMac avatar Jan 04 '22 17:01 stdevMac

Add make option (something like APPBUILDER-CLEANUP-DOCKER-IMAGE_AFTER_EXPORT=1) that is passed through to appbuilder such that after export it deleted the docker image before continuing.

paulcallen avatar Jan 10 '22 21:01 paulcallen