0

When storing docker images in a file system, I want to know if I can intentionally fragment the file into an Overlay2 structure and save it separately in each layer, so I'm trying to run various docker images as containers.

However, it's not easy to see this because you don't know the actual scenario of the container environment (I'm not sure where docker images contain source code or program files). So I have two questions.

  1. First of all, when I save the docker image in the file system, can I intentionally fragment the file into the structure of overlay2 and divide it into each layer and save it?

  2. If possible, how can I check this? (Check overlay2 directory or diff directory)

  3. In addition, in general situations, when operating a service configured in a docker container environment, which directory should I check to learn in detail how the source code, programs, and executables of the image are stored on the layer? (I want to check it with my own eyes.)

I studied Docker and UFS and learned that image layers were created when building Docker files.

However, we could only verify that the directory on each layer was chained in the var/lib/docker/overlay2 directory or the directory named SHA256 and could not visually determine which directory the source code or program was stored in.

Thank you!

swlee
  • 3
  • 2
  • Do you have a specific goal with this, or something that relates to your application's source code or development process? The normal advice is to not look at anything in `/var/lib/docker` at all, particularly since Docker isn't guaranteed to be using overlay2 for the file-storage layer. – David Maze Mar 06 '23 at 15:11
  • After fragmenting files and storing them in each layer, we are studying the possibility that files that were fragmented can be merged into one file again through the combined properties of the file system at the time of container execution. (regardless of the original purpose of the container) So, two questions came up. 1. When building an image, is it possible to save only the specified files on the specified layer? 2. If (1) is possible, is the file considered as one in the file system at the time of container execution? – swlee Mar 08 '23 at 03:39

0 Answers0