diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..137decd4
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,34 @@
+FROM golang:1.22.4-alpine AS base
+RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
+RUN apk add --no-cache \
+ make \
+ clang15 \
+ libbpf-dev \
+ bpftool \
+ curl \
+ git
+ENV PATH=$PATH:/usr/lib/llvm15/bin
+
+
+FROM base AS build
+ARG BUILD_PATH=${BUILD_PATH:-/go/huatuo-bamai}
+ARG RUN_PATH=${RUN_PATH:-/home/huatuo-bamai}
+WORKDIR ${BUILD_PATH}
+COPY . .
+RUN make && \
+ mkdir -p ${RUN_PATH}/bpf && \
+ mkdir -p ${RUN_PATH}/tracer && \
+ cp ${BUILD_PATH}/_output/bin/huatuo-bamai ${RUN_PATH}/huatuo-bamai && \
+ cp ${BUILD_PATH}/huatuo-bamai.conf ${RUN_PATH}/huatuo-bamai.conf && \
+ cp ${BUILD_PATH}/bpf/*.o ${RUN_PATH}/bpf/ && \
+ find ${BUILD_PATH}/cmd -type f -name "*.bin" -exec cp {} ${RUN_PATH}/tracer/ \;
+# Comment following line if elasticsearch is needed and repalce the ES configs in huatuo-bamai.conf
+RUN sed -i 's/"http:\/\/127.0.0.1:9200"/""/' ${RUN_PATH}/huatuo-bamai.conf
+
+
+FROM alpine:3.22.0 AS run
+ARG RUN_PATH=${RUN_PATH:-/home/huatuo-bamai}
+RUN apk add --no-cache curl
+COPY --from=build ${RUN_PATH} ${RUN_PATH}
+WORKDIR ${RUN_PATH}
+CMD ["./huatuo-bamai", "--region", "example", "--config", "huatuo-bamai.conf"]
\ No newline at end of file
diff --git a/README.md b/README.md
index d70cd5e4..bb970093 100644
--- a/README.md
+++ b/README.md
@@ -17,11 +17,27 @@
# 快速上手
-为用户开发者快速体验 HUATUO, 我们提供容器编译镜像的便捷方式,一键运行 docker compose 即可启动。该命令会启动 elasticsearch, prometheus, grafana 以及编译的 huatuo-bamai 组件。上述命令执行成功后,打开浏览器访问 http://localhost:3000 即可浏览监控大盘。
-```bash
-$ docker compose --project-directory ./build/docker up
-```
+- **极速体验**
+如果你只关心底层原理,不关心存储、前端展示等,我们提供了编译好的镜像,已包含 HUATUO 底层运行的必要组件,直接运行即可:
+ ```bash
+ $ docker run --privileged --network=host -v /sys:/sys -v /run:/run huatuo/huatuo-bamai:latest
+ ```
+
+- **快速搭建**
+如果你想更进一步了解 HUATUO 运行机制,架构设计等,可在本地很方便地搭建 HUATUO 完整运行的所有组件,我们提供容器镜像以及简单配置,方便用户开发者快速了解 HUATUO。
+ 
+
+
+ HUATUO 组件运行示意图
+
+
+
+ 为快速搭建运行环境,我们提供一键运行的方式,该命令会启动 [elasticsearch](https://www.elastic.co), [prometheus](https://prometheus.io), [grafana](https://grafana.com) 以及 huatuo-bamai 组件。命令执行成功后,打开浏览器访问 [http://localhost:3000](http://localhost:3000) 即可浏览监控大盘。
+
+ ```bash
+ $ docker compose --project-directory ./build/docker up
+ ```
# 软件架构

diff --git a/README_EN.md b/README_EN.md
index 677f634b..535ae143 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -12,15 +12,25 @@ HuaTuo also integrates core technologies such as automated tracing, profiling, a
- **Smooth Transition** to Popular Observability Stacks: Provides standard data sources for Prometheus and Pyroscope, integrates with Kubernetes container resources, and automatically correlates Kubernetes labels/annotations with kernel event metrics, eliminating data silos, ensuring seamless integration and analysis across various data sources for comprehensive system monitoring.
# Getting Started
-## run
-HuaTuo provides a convenient way for quick getting started, all in one command as below:
-```bash
-$ docker compose --project-directory ./build/docker up
-```
-Run it in the project root directory, then open [http://localhost:3000](http://localhost:3000) to view the panels on your browser.
+- **Instant Experience**
+If you only care about the underlying principles and not about storage backends or frontend display, we provide a pre-built image containing all necessary components for HUATO's core operation. Just run:
-The upper command starts three dependencies containers: [elasticsearch](https://www.elastic.co), [prometheus](https://prometheus.io), [grafana](https://grafana.com), then compiles and starts huatuo-bamai.
-- Data related to event-driven operations, such as Autotracing and Events, are stored in elasticsearch
+ ```bash
+ $ docker run --privileged --network=host -v /sys:/sys -v /run:/run huatuo/huatuo-bamai:latest
+ ```
+
+- **Quick Setup**
+If you want to dive deeper into HUATO's operation mechanisms and architecture, you can easily set up all components locally. We provide container images and simple configurations for developers to quickly understand HUATO.
+ 
+
+
+ HUATUO Component Workflow
+
+
+
+ For a quick setup, we provide a one-command solution to launch [elasticsearch](https://www.elastic.co), [prometheus](https://prometheus.io), [grafana](https://grafana.com) and huatuo-bamai. Once executed, click [http://localhost:3000](http://localhost:3000) to view the monitoring dashboards on your browser.
+
+- Data related to event-driven operations Autotracing and Events, are stored in elasticsearch
- Metrics-related data is actively collected and stored by prometheus
- elasticsearch data reporting port: 9200
- prometheus data source port: 9090
diff --git a/build/docker/.env b/build/docker/.env
index d3c03ca1..54dac0f8 100644
--- a/build/docker/.env
+++ b/build/docker/.env
@@ -14,6 +14,5 @@ PROMETHEUS_VERSION=v2.53.3 # LTS v2.53
# Grafana
GRAFANA_VERSION=11.0.0
-# Compile and Run huatuo-bamai
-BUILD_PATH=/go/huatuo-bamai
+# Run huatuo-bamai
RUN_PATH=/home/huatuo-bamai
diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile
deleted file mode 100644
index d487f691..00000000
--- a/build/docker/Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-# https://hub.docker.com/_/golang/tags?name=1.22.4
-FROM golang:1.22.4-alpine AS base
-ARG RUN_PATH=${RUN_PATH:-/home/huatuo-bamai}
-
-# Install dependencies for build
-RUN apk add --no-cache \
- make \
- clang15 \
- libbpf-dev \
- bpftool \
- curl
-ENV PATH=$PATH:/usr/lib/llvm15/bin
-WORKDIR ${RUN_PATH}
-CMD ["./run.sh"]
diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml
index d829607d..91fb235c 100644
--- a/build/docker/docker-compose.yml
+++ b/build/docker/docker-compose.yml
@@ -30,21 +30,20 @@ services:
- elasticsearch
huatuo-bamai:
- build:
- context: ./../../ # compile required in Dockerfile
- dockerfile: ./build/docker/Dockerfile
+ image: huatuo/huatuo-bamai:latest
container_name: huatuo-bamai
network_mode: host
privileged: true
environment:
ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-}
- BUILD_PATH: ${BUILD_PATH:-}
RUN_PATH: ${RUN_PATH:-}
volumes:
- - ../../:${BUILD_PATH}:rw # src
- - ./run.sh:${RUN_PATH}/run.sh:ro # run
- - /sys/kernel:/sys/kernel
+ - /sys:/sys
+ - /run:/run
+ - ../../huatuo-bamai.conf:${RUN_PATH}/huatuo-bamai.conf:rw
+ - ./run.sh:${RUN_PATH}/run.sh:ro
+ command: ["./run.sh"]
depends_on:
- elasticsearch
- prometheus
diff --git a/build/docker/run.sh b/build/docker/run.sh
index f6d2c0ed..44b6e74d 100755
--- a/build/docker/run.sh
+++ b/build/docker/run.sh
@@ -3,7 +3,6 @@
ELASTICSEARCH_HOST=${ELASTICSEARCH_HOST:-localhost}
ELASTIC_PASSWORD=${ELASTIC_PASSWORD:-huatuo-bamai}
-BUILD_PATH=${BUILD_PATH:-/go/huatuo-bamai}
RUN_PATH=${RUN_PATH:-/home/huatuo-bamai}
# Wait for Elasticsearch to be ready
@@ -60,42 +59,6 @@ wait_for_elasticsearch() {
fi
}
-# Compile and copy huatuo-bamai, .conf, bpf.o, cmd-tools to run path
-prepare_run_env() {
- # compile huatuo-bamai
- if [ ! -x "$BUILD_PATH/_output/bin/huatuo-bamai" ]; then
- cd $BUILD_PATH && make clean
- bpftool btf dump file /sys/kernel/btf/vmlinux format c > bpf/include/vmlinux.h || {
- echo "Failed to dump vmlinux.h"
- exit 1
- }
- make || {
- echo "Failed to compile huatuo-bamai"
- exit 1
- }
- fi
- # copy huatuo-bamai, .conf, bpf.o, cmd-tools to run path
- cp $BUILD_PATH/_output/bin/huatuo-bamai $RUN_PATH/huatuo-bamai || {
- echo "Failed to copy huatuo-bamai"
- exit 1
- }
- cp $BUILD_PATH/huatuo-bamai.conf $RUN_PATH/huatuo-bamai.conf || {
- echo "Failed to copy huatuo-bamai.conf"
- exit 1
- }
- mkdir -p $RUN_PATH/bpf && cp $BUILD_PATH/bpf/*.o $RUN_PATH/bpf/ || {
- echo "Failed to copy bpf files"
- exit 1
- }
- mkdir -p $RUN_PATH/tracer && find $BUILD_PATH/cmd/ -type f -name "*.bin" -exec cp {} $RUN_PATH/tracer/ \; || {
- echo "Failed to copy cmd-tools files"
- exit 1
- }
-}
-
-# Prepare run env for huatuo-bamai
-prepare_run_env
-echo "huatuo-bamai run env is ready."
wait_for_elasticsearch
sleep 5 # Waiting for initialization of Elasticsearch built-in users
diff --git a/docs/quick-start-cn.png b/docs/quick-start-cn.png
new file mode 100644
index 00000000..9ca3dc95
Binary files /dev/null and b/docs/quick-start-cn.png differ
diff --git a/docs/quick-start-en.png b/docs/quick-start-en.png
new file mode 100644
index 00000000..13be6689
Binary files /dev/null and b/docs/quick-start-en.png differ