我在配置容器时尝试将卷挂载到容器上
private def buildApiCheckerContainerConfig(cfg: ApiCheckerConfig): ContainerConfig = {
val specVol: Volume = client.createVolume(
Volume.builder()
.name("openapi.yaml")
.mountpoint("/app/openapi.yaml")
.build()
)
val paramsVol: Volume = client.createVolume(
Volume.builder()
.name("parameters.yaml")
.mountpoint("/app/parameters.yaml")
.build()
)
ContainerConfig.builder()
.image("andyceo/openapi-checker:latest")
.addVolumes(specVol.name(), paramsVol.name())
.cmd("openapi.yaml", "--api", s"${cfg.apiAddress}", "--parameters", "parameters.yaml")
.build()
}
但是在容器No such file or directory: '/app/openapi.yaml'
中找不到卷
如何使用spotify-docker-client做类似docker run -v /path/to/openapi.yaml:/app/openapi.yaml
的事情?