0.参考文档
https://min.io/docs/minio/container/operations/install-deploy-manage/deploy-minio-single-node-single-drive.html#id4
最开始完全按照官方文档配置,由于我拉的镜像版本较古老,导致按照文档操作会有许多问题,踩了不少坑…
后面参考了别的文章,完成搭建。
1.拉镜像
docker pull minio/minio:RELEASE.2021-06-17T00-10-46Z
2.配置环境变量
vim /home/user2/wj/minio/default/minio
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment
MINIO_ROOT_USER=jiew
MINIO_ROOT_PASSWORD=12345678
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
MINIO_VOLUMES="/home/user2/wj/minio/data/"
# MINIO_OPTS sets any additional commandline options to pass to the MinIO server.
# For example, `--console-address :9001` sets the MinIO Console listen port
#MINIO_OPTS="--console-address :9001"
# MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server
# MinIO assumes your network control plane can correctly resolve this hostname to the local machine
# Uncomment the following line and replace the value with the correct hostname for the local machine and port for the MinIO server (9000 by default).
#MINIO_SERVER_URL="http://minio.example.net:9000"
3.创容器
docker run -dt -p 12280:9000 -p 12281:9001 --name minio\
-e "MINIO_ACCESS_KEY=jiew" \
-e "MINIO_SECRET_KEY=12345678" \
-v /home/user2/wj/minio/data:/data \
-v /home/user2/wj/minio/default/minio:/root/minio \
minio/minio:RELEASE.2021-06-17T00-10-46Z server /data
pom配置
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.2.2</version>
</dependency>
我是用maven做的项目管理,很奇怪mavven load project总不能自动下载minio依赖
最后,手动下载jar包到本地然后mvn安装
https://repo1.maven.org/maven2/io/minio/minio/8.2.2/
mvn install:install-file -Dfile=C:\Users\jiew\.m2\repository\io\minio\minio\minio-8.2.2-all.jar -DgroupId=io.minio -DartifactId=minio -Dversion=8.2.2 -Dpackaging=jar