Docker-OSX icon indicating copy to clipboard operation
Docker-OSX copied to clipboard

How to build new image from already built images?

Open ranjanp75 opened this issue 3 years ago • 0 comments

Hi @sickcodes, I have a use case for CI/CD where I want to install few packages along with the bare mac OS docker image for monterey. I followed the steps below to build the custom image file and then start it as part of naked container to get it up and running.

  1. Installed monterey
  2. Installed required packages
  3. Committed the docker container.
  4. Got the img file from the /var/lib/docker path
  5. Built the docker osx naked image and was able to run it successfully.

Considering that new packages may be required to be added to the existing image, how do we go about doing that? Is the only way to store the original docker image and keep building on top of it ? I have observed that for every brew install package, the docker image size increases significantly from 40GB to 80GB which is very difficult to maintain.

Could you please help me with this ? Thanks

ranjanp75 avatar Feb 27 '22 10:02 ranjanp75