From 59f423e8dacaa916bd4277c9834ea61921f50518 Mon Sep 17 00:00:00 2001 From: Kumar Sahaj Date: Wed, 20 Sep 2023 14:38:58 +0000 Subject: [PATCH] checks --- README.md | 99 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index f862c46..0845e8f 100644 --- a/README.md +++ b/README.md @@ -11,34 +11,44 @@ sudo docker run -d --runtime=sysbox-runc -P -p :9166 --name blockbook ## Requirements Installation of Sysbox: -1. $ git clone --recursive https://github.com/nestybox/sysbox.git -2. $ make (For this step go to the sysbox directory) -3. $ make sysbox-static -4. $ sudo make install -5. $ make sysbox TARGET_ARCH=arm64 -6. $ sudo ./docker-cfg --sysbox-runtime=enable (For this step go to the scr directory) - If in step 6 command not found error comes then first install jq and then again run this command. +``` + +git clone --recursive https://github.com/nestybox/sysbox.git +make (For this step go to the sysbox directory) +make sysbox-static +sudo make install +make sysbox TARGET_ARCH=arm64 +sudo ./docker-cfg --sysbox-runtime=enable (For this step go to the scr directory) + + + ``` For Uninstalling: -1. $ sudo make uninstall -2. $ make clean +``` + +sudo make uninstall +make clean + + ``` Installation of Docker: -1. $ sudo apt update -2. $ sudo apt install -y apt-transport-https ca-certificates curl software-properties-common -3. $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/ - docker-archive-keyring.gpg -4. $ echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ - ubuntu - focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - (Replace focal with your Ubuntu version (e.g., bionic, xenial, or hirsute) if you are using a different version) -5. $ sudo apt update -6. $ sudo apt install -y docker-ce docker-ce-cli containerd.io -7. $ sudo systemctl start docker - $ sudo systemctl enable docker -8. $ sudo docker --version (If installed correctly the version will be displayed) +``` +sudo apt update +sudo apt install -y apt-transport-https ca-certificates curl software-properties-common +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/ +docker-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ +ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +sudo apt update +sudo apt install -y docker-ce docker-ce-cli containerd.io +sudo systemctl start docker +sudo systemctl enable docker +sudo docker --version + +``` ## Running Manually @@ -66,26 +76,6 @@ Installation of Docker: Use xdg-open https://localhost:/ to open the link through the terminal and can view the interface of Blockbook. - ## Code Explanation - - . We use the base image "nestybox/ubuntu-focal-systemd-docker," which is an Ubuntu-based image with systemd for managing system - services. - . We update the package list and installs necessary packages like wget, gnupg2, software-properties-common, and unzip. - . The Dockerfile downloads a ZIP archive containing Debian (.deb) files from a GitHub repository and extracts them. - . Within the extracted directory, it installs two Debian packages ("dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb" and - "dind_blockbook-flo_0.4.0_amd64.deb") using apt. - . It exposes three ports (22, 80, and 9166) for potential network access. - . The CMD instruction specifies the default command to run when a container is started based on this image. In this case, it starts the - systemd initialization process. - - ### Why Sysbox Is Used ? - - . When you run Docker containers inside a Docker container (DinD), the inner containers typically share the same Docker daemon as the - host and other containers. This can lead to security and isolation concerns. Sysbox allows you to run containers within an isolated environment, providing stronger separation between inner containers, the host, and other outer containers. This is achieved by creating separate container runtimes for each inner container using runc (the OCI runtime). - . In our dockerfile we are able to execute systemctl command by using sysbox. - - - ## Testing The code and steps required to run Docker version of Blockbook block explorer @@ -110,4 +100,27 @@ sudo docker run -v /var/run/docker.sock:/var/run/docker.sock -ti ubuntu:20.04 sudo docker run -d --runtime=sysbox-runc -P -p 9167:9166 5018bee64419 sudo docker run -d --runtime=sysbox-runc --net=host -P 5018bee64419 -``` \ No newline at end of file +``` + + ## Code Explanation + + . We use the base image "nestybox/ubuntu-focal-systemd-docker," which is an Ubuntu-based image with + systemd for managing system services. + . We update the package list and installs necessary packages like wget, gnupg2,software-properties-common, + and unzip. + . The Dockerfile downloads a ZIP archive containing Debian (.deb) files from a GitHub repository and + extracts them. + . Within the extracted directory, it installs two Debian packages ("dind_backend-flo_0.15.1.1-satoshilabs + -1_amd64.deb" and "dind_blockbook-flo_0.4.0_amd64.deb") using apt . + . It exposes three ports (22, 80, and 9166) for potential network access. + . The CMD instruction specifies the default command to run when a container is started based on this + image. In this case, it starts the systemd initialization process. + + + ### Why Sysbox Is Used ? + + . When you run Docker containers inside a Docker container (DinD), the inner containers typically share + the same Docker daemon as the host and other containers. This can lead to security and isolation concerns. + . Sysbox allows you to run containers within an isolated environment, providing stronger separation + between inner containers, the host, and other outer containers. This is achieved by creating separate container runtimes for each inner container using runc (the OCI runtime). + . In our dockerfile we are able to execute systemctl command by using sysbox.