Orbstack 使用 docker 搭建各类开发环境

nginx-proxy-manager

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- nginx-proxy-manager_data:/data
- nginx-proxy-manager_letsencrypt:/etc/letsencrypt
volumes:
nginx-proxy-manager_data:
nginx-proxy-manager_letsencrypt:

dozzle

docker 容器日志查看

1
2
docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest

1
2
docker run --name dozzle -d  -p 8888:8080 amir20/dozzle:latest

postgresql

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -v pgdata:/var/lib/postgresql/data -d postgres



docker run -p 5432:5432 --name postgres -v pgdata:/var/lib/postgresql/data -d postgres

# 进入交互式环境
docker exec -it postgres psql -U postgres -d postgres

# 查看数据存放路径
show data_directory
docker cp postgres:/var/lib/postgresql/data/pg_hba.conf .
docker cp ./pg_hba.conf postgres:/var/lib/postgresql/data/pg_hba.conf .

# 重启服务
docker restart postgres

kafka kafka-manger

1
2
3
4
docker pull wurstmeister/zookeeper
docker run -d --name zookeeper -p 2181:2181 -e TZ="Asia/Shanghai" wurstmeister/zookeeper:latest
docker pull wurstmeister/kafka
docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=192.168.1.111:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.1.111:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -e TZ="Asia/Shanghai" wurstmeister/kafka:latest
1
2
3
docker pull sheepkiller/kafka-manager
docker run -d --name kfk-manager -p 9000:9000 -e ZK_HOSTS=192.168.1.111:2181 sheepkiller/kafka-manager:latest

然后访问 http://localhost:9000 查看配置

配置es 集群可视化工具

1
2
3
4
5
6
7
8
9
docker pull lmenezes/cerebro

docker run -d -p 9003:9000 \
--restart=unless-stopped \
--name cerebro \
-v cerebro:/opt/cerebro \
-h cerebro \
lmenezes/cerebro

配置 grafana

1
2
3
4
5
6
docker run -itd --name=grafana \
--restart=always \
-p 3000:3000 \
-v grafana-storage:/var/lib/grafana \
grafana/grafana

配置prometheus

1
2
docker run -itd --name=prometheus --restart=always -p 9091:9090 prom/prometheus  # 9090 被clash.meta 占用

修改镜像内的配置文件

1
vi /etc/prometheus/prometheus.yml 

配置监控器

1
2
3
4
5
6
7
docker run -itd --name=node-exporter \
--restart=always \
-p 9100:9100 \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro" \
prom/node-exporter

Clickhouse

1
2
3
4
5
6
7
8
9
10
11
docker run \
-p 8123:8123 \
-p 3500:9000 \
--name clickhouse-server \
--ulimit nofile=262144:262144 \
-e CLICKHOUSE_DB=default \
-e CLICKHOUSE_USER=root \
-e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 \
-e TZ=Asia/Shanghai \
-e CLICKHOUSE_PASSWORD=password123 \
-d clickhouse/clickhouse-server

Orbstack 使用 docker 搭建各类开发环境
https://kingjem.github.io/2024/10/14/Orbstack 配置docker环境/
作者
Ruhai
发布于
2024年10月14日
许可协议