Compare commits
10 Commits
60150aa8e4
...
3d336572be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d336572be | ||
|
|
84574b507a | ||
|
|
a684783e85 | ||
|
|
2110bb5e16 | ||
|
|
00efd27bce | ||
|
|
398b08fc00 | ||
|
|
a9f569655c | ||
|
|
a03742524c | ||
|
|
d8be353192 | ||
|
|
31c346aa3e |
76
Dockerfile
76
Dockerfile
@ -1,24 +1,52 @@
|
||||
# Use a base image
|
||||
FROM nestybox/ubuntu-focal-systemd-docker
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt update && \
|
||||
apt install -y wget gnupg2 software-properties-common unzip
|
||||
|
||||
# Download deb files based on the TESTNET environment variable
|
||||
ARG TESTNET=false
|
||||
|
||||
# If TESTNET is true, download testnet deb files; otherwise, download mainnet deb files
|
||||
RUN if [ "$TESTNET" = "true" ]; then \
|
||||
wget https://github.com/ranchimall/blockbook-docker/archive/testnet.zip && unzip testnet.zip && \
|
||||
cd blockbook-docker-testnet && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb; \
|
||||
else \
|
||||
wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip && \
|
||||
cd blockbook-docker-main && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb; \
|
||||
fi
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 22 80 9166
|
||||
|
||||
# Start your applications (Uncomment and replace with your application start commands)
|
||||
CMD ["/lib/systemd/systemd"]
|
||||
# Use a base image
|
||||
FROM cruizba/ubuntu-dind:latest
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt-get update && \
|
||||
apt-get install -y wget gnupg2 software-properties-common supervisor make git sudo
|
||||
|
||||
# Mount the Docker socket from the host into the container
|
||||
# VOLUME /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
# Build app (You can add your application build steps here)
|
||||
RUN git clone https://github.com/ranchimall/blockbook
|
||||
# WORKDIR /blockbook
|
||||
# RUN sudo make all-flo
|
||||
|
||||
# Install deb files
|
||||
# RUN sudo apt install -y ./build/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \
|
||||
# sudo apt install -y ./build/blockbook-flo_0.4.0_amd64.deb
|
||||
|
||||
# Download deb files
|
||||
# RUN wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb \
|
||||
# https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/blockbook-flo_0.4.0_amd64.deb
|
||||
|
||||
# Create run flo directory
|
||||
# RUN mkdir -p /run/flo
|
||||
|
||||
# # Create a common group (e.g., flo-group) and set permissions
|
||||
# RUN groupadd flo-group && \
|
||||
# usermod -aG flo-group flo && \
|
||||
# usermod -aG flo-group blockbook-flo && \
|
||||
# chown :flo-group /run/flo && \
|
||||
# chmod 777 /run/flo
|
||||
|
||||
# Setting up supervisor configurations (Uncomment and add your configuration files)
|
||||
COPY alt-helper.sh /
|
||||
# COPY blockbook-flo.conf /etc/supervisor/conf.d/
|
||||
# COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Create log files
|
||||
# RUN touch /var/log/backend-flo-error.log && \
|
||||
# touch /var/log/backend-flo.log && \
|
||||
# touch /var/log/blockbook-flo-error.log && \
|
||||
# touch /var/log/blockbook-flo.log
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 22 80 9166
|
||||
|
||||
# Start supervisord (Uncomment this line)
|
||||
# CMD ["/usr/bin/supervisord"]
|
||||
|
||||
# Start your applications (Uncomment and replace with your application start commands)
|
||||
CMD ["/usr/bin/bash", "/alt-helper.sh"]
|
||||
16
Main_net_Dockerfile
Normal file
16
Main_net_Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
# Use a base image
|
||||
FROM nestybox/ubuntu-focal-systemd-docker
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt update && \
|
||||
apt install -y wget gnupg2 software-properties-common unzip
|
||||
|
||||
# Download deb files
|
||||
RUN wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip
|
||||
RUN cd blockbook-docker-main && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 22 80 9166
|
||||
|
||||
# Start your applications (Uncomment and replace with your application start commands)
|
||||
CMD ["/lib/systemd/systemd"]
|
||||
32
README.md
32
README.md
@ -1,14 +1,17 @@
|
||||
# Blockbook docker
|
||||
|
||||
|
||||
## Video-Demonstration
|
||||
## Video-Demonstration For Mainnet
|
||||
+ https://drive.google.com/file/d/1MQlndJi1w992uhUtGTbf89uq0Q7mZR6k/view?usp=sharing (Only Text)
|
||||
+ https://www.youtube.com/watch?v=QKd3EriMPx0 (Both Text And Audio)
|
||||
|
||||
## Video-Demonstration For Testnet
|
||||
+ https://youtu.be/EnX3-cBbpcE (Both Text And Audio)
|
||||
|
||||
## Pre-requisites
|
||||
Should have [sysbox installed on your machine](https://github.com/nestybox/sysbox/blob/master/docs/developers-guide/build.md)
|
||||
|
||||
## Main commands
|
||||
## Main commands (For Both Mainnet and Testnet)
|
||||
```
|
||||
sudo docker run -d --runtime=sysbox-runc -P -p <hostport>:9166 --name blockbook ranchimallfze/blockbook:1.0.0
|
||||
```
|
||||
@ -76,7 +79,7 @@ sudo docker --version
|
||||
|
||||
|
||||
|
||||
## Running Manually
|
||||
## Running Manually For Both Mainnet And Testnet
|
||||
|
||||
+ After the installation of docker and sysbox run the dockerfile.
|
||||
For running first we build its docker-image by the following command:
|
||||
@ -129,7 +132,7 @@ sudo docker run -d --runtime=sysbox-runc -P -p 9167:9166 5018bee64419
|
||||
sudo docker run -d --runtime=sysbox-runc --net=host -P 5018bee64419
|
||||
```
|
||||
|
||||
## Code Explanation
|
||||
## Code Explanation For Mainnet
|
||||
|
||||
+ We use the base image "nestybox/ubuntu-focal-systemd-docker," which is an Ubuntu-based image with
|
||||
systemd for managing system services.
|
||||
@ -144,6 +147,27 @@ sudo docker run -d --runtime=sysbox-runc --net=host -P 5018bee64419
|
||||
image. In this case, it starts the systemd initialization process.
|
||||
|
||||
|
||||
## Code Explanation For Testnet
|
||||
|
||||
+ This line specifies the base image for the Docker container. It starts with a base image called nestybox/ubuntu-focal-systemd-docker,
|
||||
which includes Ubuntu Focal Fossa (20.04) with systemd support.
|
||||
+ We run a shell command inside the container during the image-building process. It updates the package list by executing apt
|
||||
update. The && operator is used to chain multiple commands in a single line.
|
||||
+ We define an argument named TESTNET with a default value of false. Docker ARGs can be used to pass values at build time, and
|
||||
in this case, it's determining whether to set up the testnet or the mainnet environment.
|
||||
+ Inside the if block, this line downloads a ZIP file containing testnet-related files from a GitHub repository using wget and
|
||||
then unzips it using unzip.
|
||||
+ If the value of TESTNET is not "true," the else block is executed.Inside the else block, similar to the if block, we download
|
||||
a different ZIP file (likely containing mainnet-related files) and unzip it.
|
||||
+ We change the working directory to the one where the mainnet ZIP file was extracted (blockbook-docker-main) and install the
|
||||
same two Debian packages as in the if block.
|
||||
+ Use of 'fi' marks the end of the conditional statement, closing the if-else block.
|
||||
+ Now we expose the ports 22, 80, and 9166 and make them accessible for communication with the host system or other containers.
|
||||
+ 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
|
||||
|
||||
24
Test_net_Dockerfile
Normal file
24
Test_net_Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
# Use a base image
|
||||
FROM nestybox/ubuntu-focal-systemd-docker
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt update && \
|
||||
apt install -y wget gnupg2 software-properties-common unzip
|
||||
|
||||
# Download deb files based on the TESTNET environment variable
|
||||
ARG TESTNET=false
|
||||
|
||||
# If TESTNET is true, download testnet deb files; otherwise, download mainnet deb files
|
||||
RUN if [ "$TESTNET" = "true" ]; then \
|
||||
wget https://github.com/ranchimall/blockbook-docker/archive/testnet.zip && unzip testnet.zip && \
|
||||
cd blockbook-docker-testnet && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb; \
|
||||
else \
|
||||
wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip && \
|
||||
cd blockbook-docker-main && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb; \
|
||||
fi
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 22 80 9166
|
||||
|
||||
# Start your applications (Uncomment and replace with your application start commands)
|
||||
CMD ["/lib/systemd/systemd"]
|
||||
23
Testnet_Dockerfile
Normal file
23
Testnet_Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
# Use a base image
|
||||
FROM nestybox/ubuntu-focal-systemd-docker
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt update && \
|
||||
apt install -y wget gnupg2 software-properties-common unzip
|
||||
|
||||
# Download and unzip the source code
|
||||
RUN wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && \
|
||||
unzip main.zip && \
|
||||
rm main.zip
|
||||
|
||||
# Change working directory to the unzipped source code directory
|
||||
WORKDIR /blockbook-docker-main
|
||||
|
||||
# Install the required Debian packages
|
||||
RUN apt install -y ./deb-files/dind_backend-flo-testnet_0.15.1.1-satoshilabs-1_amd64.deb && \
|
||||
apt install -y ./deb-files/dind_blockbook-flo-testnet_0.4.0_amd64.deb
|
||||
# Expose ports
|
||||
EXPOSE 22 80 19166
|
||||
|
||||
# Start your applications (Uncomment and replace with your application start commands)
|
||||
CMD ["/lib/systemd/systemd"]
|
||||
1
blockbook
Submodule
1
blockbook
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a586ce22e64bb5beddb42d58b6499db024487148
|
||||
Loading…
Reference in New Issue
Block a user