Docker installed on your machine. Download the relevant installer from here.
Minio needs a persistent volume to store configuration and application data. However, for testing purposes, you can launch Minio by simply passing a directory (/export in the example below). This directory gets created in the container filesystem at the time of container start. But all the data is lost after container exits.
docker run -p 9000:9000 minio/minio server /exportTo create a Minio container with persistent storage, you need to map local persistent directories from the host OS to virtual config ~/.minio and export /export directories. To do this, run the below commands
docker run -p 9000:9000 --name minio1 \
-v /mnt/export/minio1:/export \
-v /mnt/config/minio1:/root/.minio \
minio/minio server /exportdocker run -p 9000:9000 --name minio1 \
-v
7437
D:\export\minio1:/export \
-v D:\export\minio1-config:/root/.minio \
minio/minio server /exportDistributed Minio can be deployed via Docker Compose or Swarm mode. The major difference between these two being, Docker Compose creates a single host, multi-container deployment, while Swarm mode creates a multi-host, multi-container deployment.
This means Docker Compose lets you quickly get started with Distributed Minio on your computer - ideal for development, testing, staging environments. While deploying Distributed Minio on Swarm offers a more robust, production level deployment.
To override Minio's auto-generated keys, you may pass secret and access keys explicitly as environment variables. Minio server also allows regular strings as access and secret keys.
docker run -p 9000:9000 --name minio1 \
-e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
-e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
-v /mnt/export/minio1:/export \
-v /mnt/config/minio1:/root/.minio \
minio/minio server /exportdocker run -p 9000:9000 --name minio1 \
-e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
-e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
-v D:\export\minio1:/export \
-v D:\export\minio1-config:/root/.minio \
minio/minio server /exportTo override Minio's auto-generated keys, you may pass secret and access keys explicitly by creating access and secret keys as Docker secrets. Minio server also allows regular strings as access and secret keys.
echo "AKIAIOSFODNN7EXAMPLE" | docker secret create access_key -
echo "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | docker secret create secret_key -
Create a Minio service using docker service to read from Docker secrets.
docker service create --name="minio-service" --secret="access_key" --secret="secret_key" minio/minio server /export
Read more about docker service here
To use Docker commands on a specific container, you need to know the Container ID for that container. To get the Container ID, run
docker ps -a-a flag makes sure you get all the containers (Created, Running, Exited). Then identify the Container ID from the output.
To start a stopped container, you can use the docker start command.
docker start <container_id>To stop a running container, you can use the docker stop command.
docker stop <container_id>To access Minio logs, you can use the docker logs command.
docker logs <container_id>To monitor the resources used by Minio container, you can use the docker stats command.
docker stats <container_id>