官网:https://min.io/

安装minio

使用 Docker Compose 部署

  • 环境搭建

Docker 安装文档:https://docs.docker.com/engine/install/

Docker Compose 安装文档:https://docs.docker.com/compose/install/

  • 创建docker-compose.yaml文件

version: '3'
services:
    minio:
      image: minio/minio:RELEASE.2024-01-01T16-36-33Z
      container_name: minio
      deploy:
        resources:
          limits:
            cpus: 'lower'
            memory: 1G
      ports:
        - 9000:9000
        - 9001:9001
      restart: always
      command: server /data --console-address :9000 --address :9001
      environment:
        MINIO_ROOT_USER: user
        MINIO_ROOT_PASSWORD: password!
      logging:
        options:
          max-size: "5M"
          max-file: "10"
        driver: json-file
      volumes:
        - ./data:/data
  • 启动 minio 服务

docker-compose up -d

设置Region

  • Settings ->Region

添加策略

  • 配置

  • 策略内容(用户只能看到相同用户名的桶)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:DeleteBucket",
                "s3:AbortMultipartUpload",
                "s3:GetBucketNotification",
                "s3:HeadBucket",
                "s3:ListBucketMultipartUploads",
                "s3:DeleteObject",
                "s3:GetBucketPolicy",
                "s3:GetObject",
                "s3:ListenBucketNotification",
                "s3:GetBucketLocation",
                "s3:ListAllMyBuckets",
                "s3:ListBucket",
                "s3:ListMultipartUploadParts",
                "s3:PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::${aws:username}/*"
            ]
        }
    ]
}

填写上方策略内容(可以根据自己的需求定义策略)

用户组权限控制

  • 这里注意了,不能填中文