Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toquery/devdependent
开发依赖的docker服务
https://github.com/toquery/devdependent
development docker environment
Last synced: 8 days ago
JSON representation
开发依赖的docker服务
- Host: GitHub
- URL: https://github.com/toquery/devdependent
- Owner: ToQuery
- License: apache-2.0
- Created: 2017-05-16T04:49:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-07T11:15:02.000Z (about 1 year ago)
- Last Synced: 2023-10-07T12:23:24.483Z (about 1 year ago)
- Topics: development, docker, environment
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DevDependent
本文档主要介绍相关基于docker的开发依赖服务,包含容器管理、数据库、缓存、监控等。不断完善。。。
## Docker 镜像加速
[Gist](https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6)
```json
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.nju.edu.cn"
]
}
```## 容器相关服务
- ~~Linux(Mac)下启用dockerAPI,基于docker.sock~~(推荐下面的方式)
> 基于Docker镜像的方式在2376端口开放docker-api接口
```bash
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 2376:2375 bobrik/socat TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock
```- 修改docker的daemon.json开启docker-api如下,配置hosts节点
```json
{
// 可信任的镜像仓库
// "insecure-registries" : ["xxx.abc.com"],
// 镜像加速仓库
// "registry-mirrors": ["http://xxxx.m.daocloud.io"],
"hosts":["tcp://0.0.0.0:2375","unix:///var/run/docker.sock"]
}
```- portainer 容器管理
```
docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
```## 数据库相关服务
- mysql启动命令:
```bash
docker run -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 --restart=always --name mysql -d mysql:5.7.20GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxx' WITH GRANT OPTION;
FLUSH PRIVILEGES;
``````bash
docker run -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 --restart=always --name mysql8 -d mysql:8.0.27
```- postgresql
```bash
docker run --name postgres -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:16docker run --name postgres -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:14
docker run --name postgres -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:10.5
docker run --name postgres -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:9.6
```- mongodb
```bash
docker pull mongo:5.0.5
docker run --name mongodb -e MONGO_INITDB_DATABASE=admin -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=123456 -p 27017:27017 -d mongo:5.0.5
```- neo4j
```bash
docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:4.3.6
```- influxdb
```bash
docker pull influxdb:1.6docker run -p 8086:8086 --name influxdb -d influxdb:1.6
docker run -p 8086:8086 -p 8083:8083 -e ADMIN_USER="root" -e INFLUXDB_INIT_PWD="123456" -e PRE_CREATE_DB="metrics" --name influxdb -d influxdb:1.6
// 创建数据库 metrics为数据库名字
curl -G -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE metrics"
```## 缓存相关服务
- redis启动命令:
```bash
docker run -p 6379:6379 --name redis -d redisdocker run -p 6379:6379 --name redis -d redis:5.0.7 --requirepass "123456"
docker run -p 6379:6379 --name redis -d redis:7 --requirepass "123456"
```## 文件服务
### minio 服务
```
docker run -p 9000:9000 -itd --name minio \
-e "MINIO_ACCESS_KEY=admin" \
-e "MINIO_SECRET_KEY=admin123" \
minio/minio server /data
```## 账号服务 User Account and Authentication (UAA) Server
- (keycloak)[https://github.com/keycloak/keycloak]
- (cloudfoundry/uaa)[https://github.com/cloudfoundry/uaa]## 其他相关服务
- zookeeper启动命令
```bash
docker run -p 2181:2181 -p 2888:2888 -p 3888:3888 --name zookeeper -d zookeeper
```- consul
```bash
docker run -d -p 8500:8500 --name consul consul agent -server -bootstrap -client=0.0.0.0 -ui
``````bash
docker run -d --name rrshare -p 3001:3001 -v ~/Downloads:/opt/work/store oldiy/rrshare64:latest
```## 监控相关服务
- grafana
```bash
// 默认账号 admin 密码 admin
docker run -d --name=grafana -p 3000:3000 grafana/grafana
```- prometheus
```bash
docker pull prom/prometheusdocker run --name prometheus -p 9090:9090 -d prom/prometheus
docker run \
-p 9090:9090 \
-v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheusdocker run -p 9090:9090 -v /tmp/prometheus-data:/prometheus-data prom/prometheus
```