Docker 部署 minio
Docker 部署 minio
minio是分布式文件存储
一. docker命令
docker run -p 9000:9000 -p 9090:9090 --name minio -d --restart=always -e "MINIO_ACCESS_KEY=minioadmin" -e "MINIO_SECRET_KEY=minioadmin" -v /mydata/minio/data:/data minio/minio server /data --console-address ":9090" -address ":9000"
二. minio的yaml部署 http版的
services: minio-http: command: - 'server /data --console-address :9001' container_name: minio-http environment: - MINIO_ACCESS_KEY=username - MINIO_SECRET_KEY=qI7-****O6 image: minio/minio:latest logging: driver: json-file options: max-file: 10 max-size: 50M networks: - bridge ports: - 9300:9000/tcp - 9390:9001/tcp restart: always volumes: - /filestorage/9-9-TaskStorage/minio-http/data2:/data - /filestorage/9-9-TaskStorage/minio-http/config:/root/.minio networks: bridge: external: true
三. minio的yaml部署 https版的
证书位置:/root/.minio/certs
services: test-minio-ssl: command: - 'server /data --console-address :9001' container_name: test-minio-ssl environment: - MINIO_ACCESS_KEY=username - MINIO_SECRET_KEY=qI7-****O6 image: minio/minio:latest logging: driver: json-file options: max-file: 10 max-size: 5000M networks: - 9-1-minio_mynet ports: - 9200:9000/tcp - 9290:9001/tcp restart: always volumes: - /filestorage/9-1-minio/data:/data - /filestorage/9-1-minio/config:/root/.minio - /filestorage/9-1-minio/config/certs:/root/.minio/certs networks: 9-1-minio_mynet: external: true
四. 参考:
services: minio: image: quay.io/minio/minio container_name: minio_container ports: - "9000:9000" #api接口(内部访问) - "9001:9001" #控制台端口(外部界面) environment: TZ: Asia/Shanghai #时区上海 MINIO_ROOT_USER: abc #管理后台用户名 MINIO_ROOT_PASSWORD: abc #管理后台密码(最少8个字符) MINIO_COMPRESS: "off" #开启压缩(on开启,off关闭) MINIO_COMPRESS_EXTENSIONS: "" #扩展名 .pdf .doc为空,所有类型均压缩 MINIO_COMPRESS_MIME_TYPES: "" #mine类型application/pdf为空,所有类型均压缩 volumes: - "/root/docker_minio/data:/data" #映射当前目录下的打他目录至容器内/data目录 - "/root/docker_minio/config:/root/.minio" #映射配置目录 command: server --address ':9000' --console-address ':9001' /data #服务器地址是9000,服务器控制台地址是9001,数据储存在/data下 privileged: true networks: - sunner_network
五. 测试
访问:http://localhost:9290/login
帐号密码在yaml配置的环境变量里面
end.