From 095b98348109fc2e6e194a6a74d8ffd2b70725a6 Mon Sep 17 00:00:00 2001 From: beanljun Date: Mon, 5 Aug 2024 10:05:52 +0800 Subject: [PATCH] add docker doc --- docs/Docker.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/Docker.md diff --git a/docs/Docker.md b/docs/Docker.md new file mode 100644 index 0000000..e69041f --- /dev/null +++ b/docs/Docker.md @@ -0,0 +1,33 @@ +## 1.通过项目中dockerfile文件,构建项目镜像 + +```bash +cd KVstorageBaseRaft-cpp/docker +docker build --network host -t kv_raft:22.04 -f build.dockerfile . +``` + +## 2.进入docker容器 + +```bash +cd KVstorageBaseRaft-cpp/docker/scripts +#启动容器 +./run_docker.sh +#进入容器 +./into_docker.sh +``` + +## 3.在docker容器内编译代码 + +```bash +mkdir build +cd build +cmake .. +make -j4 +``` + +## 4.容器内启动程序 + +```bash +cd ../bin +./raftCoreRun -n 3 -f test.conf +``` +