1

Continuous mirroring · GitHub

 11 months ago
source link: https://gist.github.com/harshavardhana/cb6c0d4d220a9334a66d6259c7d54c95
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Continuous mirroring · GitHub

Instantly share code, notes, and snippets.

Continuous mirroring

Thanks very clear instructions!

# credentials
MINIO_ROOT_USER=access_key
MINIO_ROOT_PASSWORD=secret_key

# first bucket
MINIO_FIRST_BUCKET=first
MINIO_FIRST_BUCKET_VERSION=v1

# second bucket
MINIO_SECOND_BUCKET=second
MINIO_SECOND_BUCKET_VERSION=v1

myminio - alias for minio connection

mc:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc config host add myminio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
      
      /usr/bin/mc rm -r --force myminio/${MINIO_FIRST_BUCKET}/${MINIO_FIRST_BUCKET_VERSION};
      /usr/bin/mc mb myminio/${MINIO_FIRST_BUCKET}/${MINIO_FIRST_BUCKET_VERSION};
      /usr/bin/mc policy set download myminio/${MINIO_FIRST_BUCKET};
      
      /usr/bin/mc rm -r --force myminio/${MINIO_SECOND_BUCKET}/${MINIO_SECOND_BUCKET_VERSION};
      /usr/bin/mc mb myminio/${MINIO_SECOND_BUCKET}/${MINIO_SECOND_BUCKET_VERSION};
      /usr/bin/mc policy set download myminio/${MINIO_SECOND_BUCKET};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK