A RAFT implementation in Rust.
See the documentation for more details.
A simple logger for the project.
The RAFT implementation.
A simple remote procedure call (RPC) library for the project.
There is an example of using the rpc
library under the examples/ping
directory, basically simulating a ping service between different Docker containers. It can be run by the PowerShell script directly.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Language Files Lines Code Comments Blanks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Dockerfile 1 30 19 4 7
Markdown 1 118 0 80 38
PowerShell 1 89 59 13 17
TOML 6 73 64 0 9
───────────────────────────────────────────────────────────────────────────────
Rust 7 650 520 14 116
|- Markdown 6 262 0 211 51
(Total) 912 520 225 167
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total 16 1222 662 322 238
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
docker build . --file Dockerfile --tag dracon_img
docker network create --driver bridge dracon_network
This will create a custom network called dracon_network
.
Use docker network rm dracon_network
to remove the network after use if needed.
docker run -dit --name dracon1 --network dracon_network --rm -v ${PWD}:/proj -w /proj dracon_img
-
-d
: Run the container in the background. -
-i
: Keep STDIN open even if not attached. -
-t
: Allocate a pseudo-TTY. -
--name dracon1
: Assign name asdracon1
to the container. -
--network dracon_network
: Connect the container to thedracon_network
. -
--rm
: Automatically remove the container when it exits. -
-v ${PWD}:/proj
: Mount the current directory to the/proj
directory in the container. -
-w /proj
: Set the working directory to/proj
in the container. -
dracon_img
: The name of the image to run. -
-p 8080:80
: Map port 80 in the container to port 8080 on the host machine.
docker exec -it dracon1 bash
This will open a bash shell in the dracon1
container.
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dracon1
This will return the IP address of the dracon1
container.
docker network inspect dracon_network
This will display details of the dracon_network
including the IP addresses of the containers connected to it.
Note
TODO:
Set up IPv6 for the containers.
docker stop dracon1
As we added the --rm
flag when running the container, it will be automatically removed when stopped.