SHELL is not supported for OCI Image format

描述

在使用 podman 构建镜像时遇到报错:

SHELL is not supported for OCI Image format, [/bin/bash -c] will be ignored. Must use `docker` format

其实就是说 Dockerfile 中使用了类似 SHELL ["/bin/bash"] 的 SHELL 指令,这不是一个 OCI 映像规范的指令,仅在 docker 下可用。

解决

按照提示在构建镜像时添加 --format docker 参数即可:

podman build . --format docker