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.

3
  • can you elaborate? I do not understand Sep 30, 2015 at 20:32
  • Did you try centurylink/dockerfile-from-image to generate the Dockerfile from exist image directly ( stackoverflow.com/questions/19104847/…)
    – BMW
    Oct 1, 2015 at 0:36
  • @BMW: Yes, but it is working with existing images. My image would be new.
    – plaidshirt
    Oct 1, 2015 at 4:59

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.