Minio Docker容器不显示本地文件夹的文件

发布于 2025-02-13 03:21:13 字数 858 浏览 0 评论 0 原文

我正在尝试在Minio Docker容器中创建一个默认存储桶,而我的本地文件将其上传为默认内容。

我已经写了一个简单的Docker-Compose文件来运行Minio客户端:

version: "2.0"
services:
  minio:
    image: 'bitnami/minio:latest'
    ports:
      - '9000:9000'
      - '9001:9001'
    environment:
      MINIO_ROOT_USER: user
      MINIO_ROOT_PASSWORD: password
    volumes:
      - ~/test_data:/data

在本地文件夹 test_data 中,有一个名为 test_bucket 的文件夹,其中包含1个文本文件: QUACTION_LIST .txt

当我登录 localhost中的Minio控制台:9001 时,我设法看到了创建的默认存储桶名称 test_bucket ,但它是空的。

要仔细检查卷如果正确载于卷,我用 docker exec -it test-minio-1/bin/bash 查看了容器中代码>内部/data/test_bucket/

我不知道为什么 Question_list.txt 未显示在Minio控制台中。我试图在

我想询问是否有人会遇到类似的问题并有解决方法,至于我的实际用例,我将拥有需要用作默认存储桶中默认内容的本地文件。

预先感谢您的建设性反馈。

I am trying to create a default bucket in MiniO docker container with my local files uploaded as a default content.

I have written a simple docker-compose file to run Minio client:

version: "2.0"
services:
  minio:
    image: 'bitnami/minio:latest'
    ports:
      - '9000:9000'
      - '9001:9001'
    environment:
      MINIO_ROOT_USER: user
      MINIO_ROOT_PASSWORD: password
    volumes:
      - ~/test_data:/data

Inside the local folder test_data, there is a folder named test_bucket that contains 1 text file: question_list.txt

When I login to MiniO console in localhost:9001, I managed to see a default bucket created named test_bucket, but it is empty.

To double-check if the volume is mounted correctly, I looked inside the container with docker exec -it test-minio-1 /bin/bash and I could find the question_list.txt inside /data/test_bucket/.

I don't know why the question_list.txt is not showing up in MiniO console. I have tried to contact the developers in GitHub and it seems this is not possible.

I would like to ask if anyone faces similar issues and has a workaround, as for my actual use case, I will have GBs of local files that need to be used as default content inside the default bucket.

Thank you in advance for your constructive feedback.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

匿名的好友 2025-02-20 03:21:13

我想更新我的情况。

我的问题主要是由Minio的新功能引起的,该功能使用元数据应用版本,如他们的博客文章。事实证明,使用较旧版本的Minio的开发人员仍然可以按照此 forum

因此,为了解决我的当前问题,我复制了存储在文件夹 .minio.sys 中的旧版本中的旧配置文件中,现在我可以看到文件在我的计算机和机器和浏览器。我认为回滚米尼奥的较旧的码头图像也可以解决我当前的问题。

由于这与我手头的问题更相关,因此我将使用它作为我问题的答案。

I would like to update my situation.

My issue is mainly caused by the new feature from minio that applies versioning with metadata, as explained in their blog post. As it turns out, developers who used the older version of MinIO still could work normally as posted in this forum.

So to solve my current issue, I copy pasted the old config files stored in the folder .minio.sys from the old version of MinIO and now I can see the files appearing correctly in both my machine and the browser. I think that rolling back an older Docker image of MinIO would also solve my current issue.

As this is more relevant to my issue at hand, I will use this as the answer to my question.

不再让梦枯萎 2025-02-20 03:21:13

您可以

version: "2"
services:
  minio:
    image: minio/minio
    ports:
      - "9000:9000"
    volumes:
      - ./test/.minio/data:/export
      - ./test/.minio/config:/root/.minio
    environment:
      - "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE"
      - "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    command: server /export

  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    volumes:
      - ./my-data:/tmp/data
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc config host add myminio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
      /usr/bin/mc rm -r --force myminio/somebucketname;
      /usr/bin/mc mb myminio/somebucketname;
      /usr/bin/mc policy download myminio/somebucketname;
      /usr/bin/mc cp /tmp/data myminio/somebucketname;
      exit 0;
      "

通过此类github问题的启发: https://github.com/minio/minio/issues/4769#issuecomment-320319655

You can do it with extra service like this config:

version: "2"
services:
  minio:
    image: minio/minio
    ports:
      - "9000:9000"
    volumes:
      - ./test/.minio/data:/export
      - ./test/.minio/config:/root/.minio
    environment:
      - "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE"
      - "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    command: server /export

  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    volumes:
      - ./my-data:/tmp/data
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc config host add myminio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
      /usr/bin/mc rm -r --force myminio/somebucketname;
      /usr/bin/mc mb myminio/somebucketname;
      /usr/bin/mc policy download myminio/somebucketname;
      /usr/bin/mc cp /tmp/data myminio/somebucketname;
      exit 0;
      "

Inspired by this Github issue: https://github.com/minio/minio/issues/4769#issuecomment-320319655

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文