Sample Header Ad - 728x90

Creating docker image of my system in its current state

0 votes
0 answers
414 views
I want to create a docker image of my own system in its current state. Here , i found a method that uses the debootstrap tool to create an image: $ sudo debootstrap focal focal > /dev/null $ sudo tar -C focal -c . | docker import - focal According to debootstrap documentation: debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] debootstrap bootstraps a basic Debian system of SUITE into TARGET from MIRROR by running SCRIPT. MIRROR can be an http:// or https:// URL, a file:/// URL, or an ssh:/// URL., a file:///(...) i am no expert in operational systems, so it isnt clear to me if this tool works as i intend. Trying to copy all my system i naively tried: sudo debootstrap / my_system > /dev/null in the hopes that, since files are accepted, "/" would represent my root directory and all would be used by debootstrap. It didnt work. It just generated a folder called my_system with a subfolder called debootstrap and a file called debootstrap.log with the content: > /usr/sbin/debootstrap: 484: : Permission denied any tips on how to do this or suggestion of better tools to create docker images of my current installation? Edit after Virsacer comment about X-Y question: Adding context: the need to create a docker image from my system came because a given project has fallen into my hands and i need to understand the project quickly. My main idea was to create an environment that would simulate the project operating environment so that i could test new implementations and, in general, make modifications without screwing things up. Three main things make my job difficult: 1 - It is not just a set of codes. The operating environment itself is part of the project since its made to control and monitor in-house made hardware. 2 - It is not well documented. I have little detail about what services need to be running, what environment vars need to be set, etc. for the whole project to work. 3 - The only testing environments i have right now are the ones that are already being used, so testing is pretty limited to not affect current operation. I had two strategies in mind to be able to create my simulating environment: making an ISO image of the system and making a docker image of the system. Making an ISO image seems plausible, but i wanted to 1 - Seize the oportunity to learn something new; 2 - Have the redundancy of creating the environment in two different working ways. 3 - Have the container as a more portable way of replicating the environment when needed. So i thought about creating the image, continuously getting rid of anything that doesnt seem needed for the project, testing and creating a new, lighter image if testing results successful.
Asked by Marco Montevechi Filho (187 rep)
Aug 13, 2022, 03:29 PM
Last activity: Aug 13, 2022, 05:18 PM