-
Notifications
You must be signed in to change notification settings - Fork 39
devops spring26 09-Base Safonova #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LiudmilaSafonova
wants to merge
1
commit into
inview-club:main
Choose a base branch
from
LiudmilaSafonova:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Case solution | ||
| For this case I made a new Ubuntu VM with access to the Internet. | ||
|
|
||
| ## Base | ||
| ### **1. Set up infrastructure for creating and running virtual machines** | ||
| Firstly, I installed packages for working with VMs on linux (where Linux acts as a hypervisor): | ||
|
|
||
| ``` | ||
| sudo apt update | ||
| sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients virtinst bridge-utils | ||
| ``` | ||
| I also ensured that the user could run commands without constant use of sudo command | ||
| <img width="1968" height="246" alt="image" src="https://github.com/user-attachments/assets/69c7280c-d720-4f51-a44f-61ed7491cddd" /> | ||
|
|
||
| At first, unfortunately, my VM was not supporting nested virtualization, which is critical for KVM. I modified the VM configuration parameters to enable virtualization support. | ||
| <img width="2626" height="416" alt="image" src="https://github.com/user-attachments/assets/0fe83151-3175-43dc-9962-9dee76b930bd" /> | ||
|
|
||
| I added parameters to VMs config and ended up having VM suppurting virtualization | ||
| <img width="1763" height="313" alt="Снимок экрана 2026-03-24 225808" src="https://github.com/user-attachments/assets/b88992fe-0712-4132-b420-79e74ad78b0c" /> | ||
| <img width="1483" height="164" alt="Снимок экрана 2026-03-24 230025" src="https://github.com/user-attachments/assets/d0496884-9c08-48c9-af54-44ab81261e3f" /> | ||
| <img width="1741" height="214" alt="Снимок экрана 2026-03-24 231918" src="https://github.com/user-attachments/assets/f2fcf8b5-cf3d-4fa9-982c-296d77e7209d" /> | ||
| <img width="1230" height="112" alt="image" src="https://github.com/user-attachments/assets/6e8de77b-5874-4f0e-ac32-87e3f36257f2" /> | ||
| module kvm was successfilly installed | ||
| <img width="1848" height="272" alt="image" src="https://github.com/user-attachments/assets/25caa81c-35d6-4ac7-863b-6537edc0c509" /> | ||
|
|
||
| The kvm module was successfully installed and verified. I also downloaded the Astra Linux SE 1.7.6 ISO. | ||
| ### **2. Create a virtual machine and install necessary packages** | ||
| Installing the VM using `virt-install` command: | ||
| ``` | ||
| sudo virt-install \ | ||
| --name astra_vm \ | ||
| --ram 2048 \ | ||
| --vcpus 2 \ | ||
| --os-variant debian10 \ | ||
| --network network=default \ | ||
| --graphics vnc,listen=0.0.0.0 \ | ||
| --cdrom ~/Downloads/installation-1.7.6.11-26.08.24_17.26.iso \ | ||
| --disk path=/home/ludk/astra_disk.qcow2,size=12,format=qcow2,sparse=true \ | ||
| --check all=off \ | ||
| --filesystem /home/ludk/astra_share,astra_common,type=mount,accessmode=passthrough | ||
|
|
||
| ``` | ||
|
|
||
| Then set OS and via ssh got into astra from Ubuntu VM | ||
| <img width="2448" height="904" alt="image" src="https://github.com/user-attachments/assets/fb5edefb-0dde-4f0d-a805-af399bd8d2ef" /> | ||
| installed `docker.io` and `debootstrap` | ||
|
|
||
| ### **3. Create a Docker image in .tar format using debootstrap** | ||
| I configured an isolated `chroot` environment with basic packages (`ncurses-term`, `nano`, `locales`) | ||
| <img width="2750" height="262" alt="image" src="https://github.com/user-attachments/assets/577ca8d6-8778-4349-9a3f-6b88cf9c80fc" /> | ||
|
|
||
| made `.tar` with flag `-p` to preserve original permissions for all directories | ||
| ``` | ||
| sudo tar -cpzf ~/astra-base.tar.gz . | ||
| ``` | ||
| using `scp` copied `.tar` file to original Ubuntu VM | ||
| <img width="2696" height="222" alt="image" src="https://github.com/user-attachments/assets/b619c334-f178-4e58-a4d2-10c185f71a56" /> | ||
| and than | ||
| <img width="2484" height="1528" alt="image" src="https://github.com/user-attachments/assets/cd8437cd-c342-4aeb-892c-60caf8bcae0b" /> | ||
| `debootstrap` worked well | ||
| <img width="1874" height="352" alt="image" src="https://github.com/user-attachments/assets/f045b676-b208-4b11-9614-ab1e1072c12f" /> | ||
|
|
||
| ### Conclusion | ||
| I was happy to know that this custom-made image weights significantly less, than the original OS. While working on this case, I had to rebuild several times my Ubuntu VM Hard Disk, reinstall Astra Linux from .iso, because 8 GB wasn't enough at first. And after all manipulations docker container is only 224 MB!! | ||
| <img width="1510" height="182" alt="image" src="https://github.com/user-attachments/assets/e4282d39-c78e-45bb-84ec-022df9cf60a7" /> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавь изображения в отдельную папку в solutions и сделай ссылку