How to build new image from already built images? #330

Open
opened 2025-12-29 00:24:30 +01:00 by adam · 0 comments
Owner

Originally created by @ranjanp75 on GitHub (Feb 27, 2022).

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

Originally created by @ranjanp75 on GitHub (Feb 27, 2022). 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#330