Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup from self-hosted minio to S3 provider #4511

Closed
giacomo-zanichelli opened this issue Mar 20, 2023 · 2 comments
Closed

Backup from self-hosted minio to S3 provider #4511

giacomo-zanichelli opened this issue Mar 20, 2023 · 2 comments

Comments

@giacomo-zanichelli
Copy link

Expected behavior

I would like to deploy minio/mc in docker and use mc mirror once a day to backup my buckets to a different S3 provider

Actual behavior

I have the following docker-compose snippet:

  minio:
    container_name: minio
    image: quay.io/minio/minio:RELEASE.2023-01-02T09-40-09Z
    command: server /data --console-address ":9001"
    user: ${MINIO_UID}:${MINIO_GID}
    restart: always
    security_opt:
      - no-new-privileges:true
    networks:
      - t2_proxy
      - backend_network
    volumes:
      - type: bind
        source: $APPDATA/minio/data
        target: /data
    secrets:
      - minio-root-user
      - minio-root-password
    environment:
      - MINIO_ROOT_USER_FILE=/run/secrets/minio-root-user
      - MINIO_ROOT_PASSWORD_FILE=/run/secrets/minio-root-password

      - MINIO_BROWSER_REDIRECT_URL=https://s3.$DOMAINNAME
 
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=t2_proxy"

      ## HTTP Routers
      - "traefik.http.routers.minio-rtr.entrypoints=https"
      - "traefik.http.routers.minio-rtr.rule=Host(`s3.$DOMAINNAME`)"
      - "traefik.http.routers.minio-rtr.tls=true"
      - "traefik.http.routers.minio-rtr.middlewares=chain-oidc@file"
      - "traefik.http.routers.minio-rtr.service=minio-svc"

      ## HTTP Services
      - "traefik.http.services.minio-svc.loadbalancer.server.port=9000"

  minio-mc:
    container_name: minio-mc
    image: minio/mc
    depends_on:
      - minio
    networks:
      - backend_network
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc alias minio-local <MINIO URL> <ACCESS KEY> <SECRET KEY>;
      /usr/bin/mc alias minio-remote <REMOTE PROVIDER> <ACCESS KEY> <SECRET KEY>;
      /usr/bin/mc mirror minio-local/bucket minio-remote/bucket;
      exit 0;
      "

The problem is that the minio-mc container exists after executing the entrypoint commands. Ideally I would like the container to keep running so that I can issue a mirror command once a day or so (outside of compose) for backing up my buckets.

Any other pointer on how to back up minio buckets from within docker would be appreciated.

Thanks

@vadmeste
Copy link
Member

Closing as this is not an issue.

@klauspost
Copy link
Contributor

Feel free to ask on https://github.com/minio/minio/discussions

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

No branches or pull requests

3 participants