我需要使用docker-compose.yml将我的本地文件“Wiremock files”复制到wiremock容器中。
我的文件路径是:
我在docker-compose中生成下一个Wiremock图像
wiremock:
image: '${WIREMOCK_IMAGE}'
volumes:
- ./src/test/resources/wiremock-docker/wiremock/__files/:/home/wiremock/__files
- ./src/test/resources/wiremock-docker/wiremock/mappings:/home/wiremock/mappings
exposedPorts: [8080/tcp]
attachStdin: true
attachSterr: true
dnsSearch: [losthost]
alwaysPull: false
portBindings: [8585->8080/tcp]
我尝试使用卷,但文件夹“__files”和“mapping”中的文件没有复制到图像中
卷:
- ./src/test/resources/wiremock-docker/wiremock/__files/:/home/wiremock/__files
- ./src/test/resources/wiremock-docker/wiremock/mappings:/home/wiremock/mappings**
我知道使用Dockerfile有效:
FROM rodolpheche/wiremock
EXPOSE 8585 8080 8081
COPY wiremock /home/wiremock
但在这种情况下,我需要从docker-compose
复制文件答案 0 :(得分:1)
docker-compose只挂载卷而不将它们复制到图像中