官网:https://www.minio.org.cn/docs/cn/minio/container/index.html
mkdir -p /data/minio/data sudo docker run \ -p 9001:9000 \ -p 9090:9090 \ --name minio \ -v /data/minio/data:/data \ -e "MINIO_ROOT_USER=admin" \ -e "MINIO_ROOT_PASSWORD=admin123" \ quay.io/minio/minio server /data --console-address ":9090"
The example above works this way:
-
mkdir
creates a new local directory at~/minio/data
in your home directory. -
docker run
starts the MinIO container. -
-p
binds a local port to a container port. -
-name
creates a name for the container. -
-v
sets a file path as a persistent volume location for the container to use. When MinIO writes data to/data
, that data mirrors to the local path~/minio/data
, allowing it to persist between container restarts. You can replace~/minio/data
with another local file location to which the user has read, write, and delete access. -
-e
sets the environment variablesMINIO_ROOT_USER
andMINIO_ROOT_PASSWORD
, respectively. These set the root user credentials. Change the example values to use for your container.