是否可以在 docker-compose as image 中指定本地 .tar(docker 图像) 文件路径?

Is it possible specify local .tar(docker image) file path in docker-compose as image?

我有 docker 图像的 .tar 文件并将其存储在本地文件存储中。我想使用 docker-compose.yaml 文件导入此图像。当然,我们可以为此使用 docker import 命令,但我想使用 docker-compose.

没有。您不能从 docker-compose 文件

中引用 tar

它应该是 Dockerfile 的路径或 git 仓库地址

文档位于:https://docs.docker.com/compose/compose-file/compose-file-v3/#context