如何使用docker-java library创建具有命名docker卷的容器
发布于 2020-08-25 21:51:18
好的,我找到了解决方案:
Volume newVolume = new Volume("/target");
Bind bind = new Bind(namedVolumeName, newVolume);
CreateContainerResponse container = dockerClient.createContainerCmd(imageId)
.withName(containerName)
.withHostConfig(HostConfig.newHostConfig().withBinds(bind))
.exec();https://stackoverflow.com/questions/63580286
复制相似问题