docker-compose 安装 minio

1.yml文件

version: '3.8'
services:
  minio:
    image: bitnami/minio:2022-debian-11
    privileged: true
    ports:
      - '9000:9000' 
      - '9001:9001' # Web Console | username: minio | password: miniosecret
    volumes:
      - ./data:/data
      - ./config:/root/.minio
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
      CONTAINER_TIMEZONE: Asia/Shanghai
    command: minio server /data --console-address ":9001"

2.data目录添加权限

注意给data目录添加777权限
chmod -R 777 ./data

root@libai-PC:/home/wowo/enviroment/minio# ls -l
总用量 12
drwxr-xr-x 2 wowo wowo 4096 926 10:17 config
drwxrwxrwx 4 wowo wowo 4096 926 11:04 data
-rw-r--r-- 1 wowo wowo  454 926 11:03 docker-compose.yml
root@libai-PC:/home/wowo/enviroment/minio# chmod -R 777 ./data

3.错误情况

minio-minio-1 | ERROR Unable to initialize backend: mkdir /data/.minio.sys/tmp/503ccab6-8509-4779-aa2c-74f4c022879b: p
原因:没有给data目录添加权限

你可能感兴趣的:(云原生,docker,linux,运维)