问题
我(拼命地)尝试在 podman 中复制此 mlflow/minio 设置:https://github.com/minio/blog-assets/blob/main/mlflow-minio-setup/docker-compose.yml。本教程在 VM 中使用 docker-compose 运行良好。
然而,在 podman 中,我根本无法弄清楚如何执行脚本以在 minio 中自动创建存储桶。我尝试了 --entrypoint 选项的许多可能组合,但总是失败:Error: crun: executable file [/bin/sh,-c,/create_bucket.sh] not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
...
我的配置
创建存储桶:
#!/bin/sh
sleep 5;
/usr/bin/mc config host add mlflow_minio_storage http://mlflow_minio_storage:9000 "$MINIO_ACCESS_KEY" "$MINIO_SECRET_ACCESS_KEY" --api S3v4;
/usr/bin/mc ls mlflow_minio_storage | grep -q challenge || /usr/bin/mc mb mlflow_minio_storage/mlflow;
/usr/bin/mc policy download mlflow_minio_storage/mlflow;
exit 0;
Dockerfile:
FROM docker.io/minio/mc
COPY create_bucket.sh /create_bucket.sh
RUN chmod +x /create_bucket.sh
podman 运行:
podman build -t minio_client:latest -f Containerfile
podman run \
--name=mlflow_minio_client \
--detach \
--secret=MINIO_ACCESS_KEY,type=env,target=MINIO_ACCESS_KEY \
--secret=MINIO_SECRET_ACCESS_KEY,type=env,target=MINIO_SECRET_ACCESS_KEY \
--net mlflow_net \
--network-alias mlflow_minio_client \
--restart always \
--requires mlflow_minio_storage \
--entrypoint ["/bin/sh","-c","/create_bucket.sh"] \
localhost/minio_client:latest
最小示例
即使这种简单的情况也会导致相同的错误。我是不是误解了什么?
podman run \
--entrypoint ["/bin/sh","-c","/usr/bin/mc version"] \
docker.io/minio/mc:latest
>>> Error: crun: executable file `[/bin/sh,-c,/usr/bin/mc version]` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found