Docker安装Minio
docker-compose.yml:
version: '3'
services:minio:image: minio/minio:RELEASE.2023-04-13T03-08-07Zcontainer_name: minioports:# api 端口- "9000:9000"# 控制台端口- "9001:9001"environment:# 时区上海TZ: Asia/Shanghai# 管理后台用户名MINIO_ROOT_USER: root# 管理后台密码,最小8个字符MINIO_ROOT_PASSWORD: root# https需要指定域名#MINIO_SERVER_URL: "https://xxx.com:9000"#MINIO_BROWSER_REDIRECT_URL: "https://xxx.com:9001"# 开启压缩 on 开启 off 关闭MINIO_COMPRESS: "off"# 扩展名 .pdf,.doc 为空 所有类型均压缩MINIO_COMPRESS_EXTENSIONS: ""# mime 类型 application/pdf 为空 所有类型均压缩MINIO_COMPRESS_MIME_TYPES: ""volumes:# 映射当前目录下的data目录至容器内/data目录- /docker/minio/data:/data# 映射配置目录- /docker/minio/config:/root/.minio/command: server --address ':9000' --console-address ':9001' /data # 指定容器中的目录 /dataprivileged: truenetwork_mode: "host"
Docker安装Redis
docker-compose.yml:
version: '3'
services:redis:image: redis:latestcontainer_name: redisports:- "6379:6379"command: redis-server --requirepass rootvolumes:- /docker/redis/data:/data
- 此处仅为最基础配置,后续复杂配置持续添加。
Docker安装Jenkins
重要一点,设置用户组:
#设置挂载卷
mkdir /docker/jenkins/jenkins_home
#设置用户组,否则在启动日志会报权限错误
chown -R 1000:1000 /docker/jenkins/jenkins_home
docker-compose.yml:
version: '3'
services:jenkins:image: jenkins/jenkins:ltscontainer_name: jenkinsports:- "8080:8080"- "50000:50000"volumes:- /docker/jenkins/jenkins_home:/var/jenkins_homeenvironment:- JENKINS_JAVA_OPTS=-Djenkins.install.runSetupWizard=false- TZ=Asia/Shanghai # 设置时区restart: always # 总是在容器停止时重新启动
- 此处仅为最基础配置,后续复杂配置持续添加。
卡加载页面解决方案:
注意: 如果界面提示:Jenkins正在启动,请稍后…或者提示: Please wait while Jenkins is getting ready to work…,并且一直在卡页面,使用如下方式解决:
- 找到jenkins工作目录,打开文件hudson.model.UpdateCenter.xml;
- 将其中的url替换(或者其他镜像)为:https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
Docker安装RocketMQ
单机版本:docker-compose.yml
version: '2'
services:namesrv:image: apache/rocketmqcontainer_name: rocketmq-namesrvports:- "9876:9876"volumes:- namesrv_data:/docker/rocketmq/databroker:image: apache/rocketmqcontainer_name: rocketmq-brokerenvironment:- NAMESRV_ADDR=rocketmq-namesrv:9876ports:- "10909:10909"- "10911:10911"volumes:- broker_data:/docker/rocketmq/storeconsole:image: apacherocketmq/rocketmq-dashboardcontainer_name: rocketmq-consoleenvironment:- ROCKETMQ_NAMESRV=rocketmq-namesrv:9876ports:- "8081:8080"volumes:namesrv_data:broker_data:
- 启动(访问ip:8081)后报错:org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to null failed,原因暂未找到,先睡觉。。。
查看Docker容器日志
docker-compose logs -f
#或者
docker logs -f [容器名称或者容器ID]
以上yml文件,只是设置了最简单的配置,后续其他组件继续添加