我有一个 docker 容器,它执行一些需要 3-7 分钟然后结束的 FTP 活动。我的 Jenkins 管道片段如下所示:
stage('Run image'){
sh '''
docker run -i -v \
--mount type=bind,source="$(pwd)/host-dirs,target=/host-dirs" \
chq-ic2e-sprint-images-docker-local.artifactory.swg-devops.com/ssc-cost-file-processor:approved
sh
'''
}
然而,码头工人说
docker: invalid reference format: repository name must be lowercase.
如果这是一个终端,我会使用 -it 函数,但这在这里不适用。我希望脚本完成它的工作然后结束。
出于测试目的,我从这样的终端运行它并且运行良好:
#!/bin/bash
docker run -it \
--mount type=bind,source="$(pwd)/host-dirs,target=/host-dirs" \
chq-ic2e-sprint-images-docker-local.artifactory.swg-devops.com/ssc-cost-file-processor:approved sh