Search code examples
docker-machineminio

mc: <error> while trying to run bitnami/minio-client the container is exiting within a seconds


I'm trying to run bitnami/minio-client image, but when I run:

docker run -it --name mc3 dockerhub:5000/bitnami/minio-client

I get this output:

08:05:31.14 Welcome to the Bitnami minio-client container
08:05:31.14 Subscribe to project updates by watching https://github.com/bitnami/containers
08:05:31.14 Submit issues and feature requests at https://github.com/bitnami/containers/issues
08:05:31.15
08:05:31.15 INFO  ==> ** Starting MinIO Client setup **
08:05:31.16 INFO  ==> ** MinIO Client setup finished! ** mc: Configuration written to `/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/.mc/share`.
mc: Initialized share uploads `/.mc/share/uploads.json` file.
mc: Initialized share downloads `/.mc/share/downloads.json` file.
****mc: <ERROR> `/opt/bitnami/scripts/minio-client/run.sh` is not a recognized command. Get help using `--help` flag.**

It would be great if someone reach out to help me how to solve this issue.


Solution

  • MinIO has two components:

    • Server
    • Client

    The Server runs continuously, as it should, so it can serve the data.

    On the other hand the client, which you are trying to run, is used to perform operations on a running server. So its expected for it to run and then immediately exit as its not a daemon and its not meant to run forever.

    What you want to do is to first launch the server container in background (using -d flag)

    $ docker run -d --name minio-server \
        --env MINIO_ROOT_USER="minio-root-user" \
        --env MINIO_ROOT_PASSWORD="minio-root-password" \
        minio/minio:latest
    

    Then launch the client container to perform some operation, for example making/creating a bucket, which it will perform on the server and exit immidieatly after which it will clean up the client container (using -rm flag).

    $ docker run --rm --name minio-client \
        --env MINIO_SERVER_HOST="minio-server" \
        --env MINIO_SERVER_ACCESS_KEY="minio-root-user" \
        --env MINIO_SERVER_SECRET_KEY="minio-root-password" \
        minio/mc \
        mb minio/my-bucket
    

    For more information please checkout the docs

    Server: https://min.io/docs/minio/container/operations/installation.html

    Client: https://min.io/docs/minio/linux/reference/minio-mc.html