Docker安装minio

Docker安装minio

开心 780 2021-08-05

1. 安装

# 查看镜像
[root@localhost ~]# docker search minio
INDEX       NAME                                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/minio/minio                    Kubernetes Native, High Performance Object...   472                  [OK]
docker.io   docker.io/minio/mc                       Minio Client (mc) provides a modern altern...   25                   [OK]
docker.io   docker.io/minio/console                  A graphical user interface for MinIO server     8                    
docker.io   docker.io/jessestuart/minio              Minio server — supports arm (arm32v6, arm3...   5                    
docker.io   docker.io/pixelchrome/minio-arm          This Dockerfile installs Minio on your ARM...   5                    
docker.io   docker.io/opennms/minion                 Application container runs Minion by OpenN...   3                    [OK]
docker.io   docker.io/webhippie/minio                Docker images for Minio                         3                    [OK]
docker.io   docker.io/rook/minio                     Minio is a high performance distributed ob...   2                    
docker.io   docker.io/azinchen/minio                 Minio server Docker image. Always up-to-da...   1                    
docker.io   docker.io/teamwork/minio                 Minio for Teamwork                              1                    
docker.io   docker.io/zenithar/minio-server          Minio.io Server in Alpine Linux docker          1                    [OK]
docker.io   docker.io/enzime/minio-docker            Modifies the default command of the minio:...   0                    [OK]
docker.io   docker.io/joepll/minio-exporter          Prometheus exporter for Minio server            0                    
docker.io   docker.io/kazesberger/miniomc-postgres   this image is used to create postgres dump...   0                    
docker.io   docker.io/keikoproj/minion-manager       https://github.com/orkaproj/minion-manager      0                    
docker.io   docker.io/kimurashuhei/minio             minio server for using it in github actions     0                    
docker.io   docker.io/leviy/minio                    Minio image for development and testing of...   0                    [OK]
docker.io   docker.io/minio/k8s-operator             Minio Operator for k8s https://kubernetes.io/   0                    
docker.io   docker.io/minio/mint                     Collection of tests to detect overall corr...   0                    [OK]
docker.io   docker.io/nerc/minio                     Minio container for use in the datalab pro...   0                    [OK]
docker.io   docker.io/opsmx11/minio                  Minio for Openshift                             0                    [OK]
docker.io   docker.io/rwsdockercf/minio-resource                                                     0                    
docker.io   docker.io/sourcegraph/minio                                                              0                    
docker.io   docker.io/tobilg/minio-dcos              minio on DC/OS                                  0                    [OK]
docker.io   docker.io/topdockercat/minio-unraid      Minio is an Amazon S3 compatible object st...   0                    [OK]

# 拉取镜像
[root@localhost ~]# docker pull minio/minio
Using default tag: latest
Trying to pull repository docker.io/minio/minio ... 
latest: Pulling from docker.io/minio/minio
158b4527561f: Pull complete 
a3ba00ce78fe: Pull complete 
e5fb44c2ce95: Pull complete 
48b3a348e261: Pull complete 
0b9bd949e073: Pull complete 
9dedf020615e: Pull complete 
16b0ed86109a: Pull complete 
Digest: sha256:9daf9c4b2be5b19b8bf40d3cc9a6026b94d9b31582deb7365914b27c09e28573
Status: Downloaded newer image for docker.io/minio/minio:latest

# 启动容器
[root@localhost data]# docker run -d -p 9000:9000 \
-p 9001:9001 \
--name minio \
-e "MINIO_ROOT_USER=admin"  \
-e "MINIO_ROOT_PASSWORD=admin123456"  \
--restart=always \
-v /data/software/minio:/data \
minio/minio server /data --console-address ":9001"

# 查看运行中容器
[root@localhost data]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                  PORTS                              NAMES
52b942eb04db        minio/minio         "/usr/bin/docker-e..."   3 seconds ago       Up Less than a second   0.0.0.0:9000-9001->9000-9001/tcp   minio

-d 后台运行,-p 暴露端口,--name 容器名称,-e 设置系统变量,--restart=always 自动启动镜像,-v 挂载文件,data 指定目录存放文件
9000 为数据通讯接口,9001 为管理后台接口
admin admin123456,用户名和密码
/data/software/minio,本地挂载目录

2. 开放端口

firewall-cmd --zone=public --add-port=9000-9001/tcp --permanent
firewall-cmd --reload

3. 访问:http://192.168.1.102:9001

image.png

image.png

4. 问题

Unable to initialize backend: mkdir /data/.minio.sys: permission denied
解决方案:修改 /etc/sysconfig/selinux,将 SELINUX 的值改为 permissive

Access key length should be at least 3, and secret key length at least 8 characters
解决方案:设置新的密钥长度


# docker # minio