MiniO docker container does not show files from local folder
Asked Answered
D

2

10

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.

Dot answered 5/7, 2022 at 9:28 Comment(0)
D
6

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.

Dot answered 20/7, 2022 at 7:19 Comment(0)
D
1

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

Dempster answered 5/7, 2022 at 9:53 Comment(3)
hi mostafa8026, thanks for the reply, this solution works, although unfortunately that means I have to use minio/minio and minio/mc rather than the original bitnami/minio docker that I originally intended.Dot
I think you can change the charts so you can use helm charts in this way, but I have no idea how to implement that at the moment.Dempster
thanks for the additional comments, but that means there is still no possible solutions using bitnami/minioDot

© 2022 - 2024 — McMap. All rights reserved.