1、config.env

# 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=myminioadmin
MINIO_ROOT_PASSWORD=minio-secret-key-change-me

# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.

MINIO_VOLUMES="/mnt/data"

# MINIO_OPTS sets any additional commandline options to pass to the MinIO server.
# 例如, `--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"

2、docker-compose.yml

minio-alias1:
    container_name: "minio-alias1"
    hostname: "minio-alias1"
    image: "minio/minio"
    command: [
        "minio",
        "server",
        "--console-address",
        ":9001"
    ]
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_CONFIG_ENV_FILE: /etc/config.env
    networks:
      network-01:
        aliases:
          - minio-net1
    restart: always
    volumes:
      - "E:/config/minio/config.env:/etc/config.env"
      - "E:/data/minio:/mnt/data"

  imgproxy-alias1:
    container_name: "imgproxy-alias1"
    hostname: "imgproxy-alias1"
    image: "darthsim/imgproxy"
    ports:
      - "8080:8080"
    environment:
      IMGPROXY_BASE_URL: "http://minio-alias1:9000/"
    networks:
      network-01:
        aliases:
          - imgproxy-net1
    restart: always

3、访问测试

# 若配置环境变量 IMGPROXY_BASE_URL,只能访问对应地址的图片,域名可省略
http://localhost:8080/_/rs:auto:300:800/plain/test/001.png
或
http://localhost:8080/_/rs:auto:300:800/plain/http://minio-alias1:9000/test/001.png
# 若没有配置环境变量 IMGPROXY_BASE_URL,需输入完整图片地址
http://localhost:8080/_/rs:auto:300:800/plain/https://www.baidu.com/img/001.png


3.1 如果使用签名访问,后面的链接需要使用url编码,例:

    http://localhost:8080/_/rs:auto:300:800/plain/test%2F001.png%3FX-Amz-xxx

# Resize
resize:%resizing_type:%width:%height:%enlarge:%extend
rs:%resizing_type:%width:%height:%enlarge:%extend

#  This is a meta-option that defines the resizing type, width, height, enlarge, and extend.
#  All arguments are optional and can be omitted to use their default values.

# resizing_type Default: fit
fit:调整图像大小,同时保持宽高比以适合给定的大小。
fill:调整图像大小,同时保持纵横比以填充给定大小并裁剪投影部分。
fill-down:与fill相同,但如果调整后的图像小于请求的大小,imgproxy将裁剪结果以保持请求的宽高比。
force:调整图像大小而不保持纵横比。
auto:如果源尺寸和结果尺寸具有相同的方向(纵向或横向),imgproxy将使用fill。否则,它将使用fit。

4、minio文档minio官网

5、imgproxy文档