Is it possible to generate a Dockerfile from an image?

Technology CommunityCategory: DockerIs it possible to generate a Dockerfile from an image?
VietMX Staff asked 3 years ago

To understand how a docker image was built, use the command:

$ docker history --no-trunc <IMAGE_ID>

You can build a docker file from an image, but it will not contain everything you would want to fully understand how the image was generated. Reasonably what you can extract is the:

  • MAINTAINER,
  • ENV,
  • EXPOSE,
  • VOLUME,
  • WORKDIR,
  • ENTRYPOINT,
  • CMD,
  • ONBUILD

parts of the dockerfile.