Search code examples
dockerminio

Docker: Unable to access Minio Web Browser


I am having trouble accessing the Minio embedded web based object browser. The http://127.0.0.1:9000 and http://127.0.0.1:45423 addresses immediately shows a "This page isn't working. ERR_INVALID_HTTP_RESPONSE".

The http://172.22.0.8:9000 and http://172.22.0.8:45423 addresses will load until timeout and land on a "This page isn't working. ERR_EMPTY_RESPONSE "

Am I missing something from my Docker setups?

docker-compose.yml:

version: "3.7"
services:
    minio-image:
        container_name: minio-image
        build:
            context: ./dockerfiles/dockerfile_minio
        restart: always
        working_dir: "/minio-image/storage"
        volumes:
            - ./Storage/minio/storage:/minio-image/storage
        ports:
            - "9000:9000"
        environment:
            MINIO_ROOT_USER: minio-image
            MINIO_ROOT_PASSWORD: minio-image-pass
        command: server /minio-image/storage

Dockerfile

FROM minio/minio:latest

CMD wget https://dl.min.io/client/mc/release/linux-amd64/mc && \
    chmod +x mc 

From minio-image container logs:

API: http://172.22.0.8:9000  http://127.0.0.1:9000 


Console: http://172.22.0.8:45423 http://127.0.0.1:45423 


Documentation: https://docs.min.io


WARNING: Console endpoint is listening on a dynamic port (45423), please use --console-address ":PORT" to choose a static port.

Logging into the docker container through cli and running pwd and ls results in: minio-image/storage and airflow-files mlflow-models model-support-files, respectively.


Solution

  • I see a few problems here.

    First, you're only publishing port 9000, which is the S3 API port. If I run your docker-compose.yml, access to port 9000 works just fine; on the Docker host, I can run curl http://localhost:9000 and get:

    <?xml version="1.0" encoding="UTF-8"?>
    <Error><Code>AccessDenied</Code><Message>Access Denied.</Message><Resource>/</Resource><RequestId>16A25441E50432A4</RequestId><HostId>b1eed50d-9218-488a-9df6-fe008e758b27</HostId></Error>
    

    ...which is expected, because I haven't provided any credentials.

    If you want to access the console, you need to do two things:

    • As instructed by the log message, you need to set a static console port using --console-address.
    • You need to publish this port in the ports section of your docker-compose.yml.

    That gives us:

    version: "3.7"
    services:
        minio-image:
            container_name: minio-image
            build:
                context: ./dockerfiles/dockerfile_minio
            restart: always
            working_dir: "/minio-image/storage"
            volumes:
                - ./Storage/minio/storage:/minio-image/storage
            ports:
                - "9000:9000"
                - "9001:9001"
            environment:
                MINIO_ROOT_USER: minio-image
                MINIO_ROOT_PASSWORD: minio-image-pass
            command: server /minio-image/storage --console-address :9001
    

    Running the above docker-compose.yml, I can access the MinIO console at http://localhost:9001, and log in using the minio-image/minio-image-pass credentials.