1

I would like to generate a Dockerfile as a "top-down approach". I have a fully configured system and would like to make an image from it to ship it away. It was built to a base image.

plaidshirt
  • 5,189
  • 19
  • 91
  • 181
  • can you elaborate? I do not understand – user2915097 Sep 30 '15 at 20:32
  • Did you try centurylink/dockerfile-from-image to generate the Dockerfile from exist image directly ( http://stackoverflow.com/questions/19104847/how-to-generate-a-dockerfile-from-an-image/30793515#30793515) – BMW Oct 01 '15 at 00:36
  • @BMW: Yes, but it is working with existing images. My image would be new. – plaidshirt Oct 01 '15 at 04:59

1 Answers1

4

It sounds like what you really want is to create a Docker image, rather than a Dockerfile. You can just tar up your filesystem and import it into Docker; e.g., something like:

tar --one-file-system -cf- / | docker import - myimagename

The --one-file-system option is to prevent tar from archiving things like /sys and /proc. This will get you a Docker image containing a copy of the filesystem; whether or not this will actually be useful probably depends on what you're trying to do with it.

larsks
  • 277,717
  • 41
  • 399
  • 399