docker-compose部署minio并创建bucket

文章目录

      • 1. docker-compose.yaml
      • 2. 部署
      • 3. 卸载
      • 4. 验证

1. docker-compose.yaml

mkdir -p /root/i/docker-compose/minio && cd /root/i/docker-compose/minio

cat < /root/i/docker-compose/minio/docker-compose.yaml
version: '3'
services:
  minio:
    restart: always
    image: minio/minio
    container_name: minio
    command: server /data --console-address ":9001"
    volumes:
      - /root/i/docker-compose/minio/data:/data
      - /root/i/docker-compose/minio/config:/root/.minio
    environment:
      MINIO_ACCESS_KEY: admin
      MINIO_SECRET_KEY: admin123
    ports:
      - 9000:9000
      - 9001:9001

  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc alias set myminio http://minio:9000 admin admin123;
      /usr/bin/mc mb myminio/test;
      exit 0;
      "
EOF
  • createbuckets:创建叫testbucket

参考 https://qa.1r1g.com/sf/ask/4648860261/

2. 部署

docker-compose -f /root/i/docker-compose/minio/docker-compose.yaml up -d

3. 卸载

docker-compose -f /root/i/docker-compose/minio/docker-compose.yaml down

4. 验证

输入 http:127.0.0.1:9001,账号密码 admin/admin123

docker-compose部署minio并创建bucket_第1张图片

你可能感兴趣的:(minio,docker-compose,minio,docker-compose)