在jenkins奴隶上运行docker build时出错

时间:2018-08-22 13:06:41

标签: docker jenkins jenkins-slave

我有一个詹金斯大师,能够从CodeCommit提取我的代码。我还设置了一个詹金斯(Jenkins)奴隶,该项目有一个构建映像的Dockerfile。当我尝试执行shell命令时,

docker build -f $WORKSPACE/BuildImage/docker/Dockerfile

我收到以下错误:

08:38:41 + docker build -f /opt/jenkins/workspace/Project/BuildImage/docker/Dockerfile
08:38:41 "docker build" requires exactly 1 argument.

1 个答案:

答案 0 :(得分:0)

I think you need to provide the path/context. So if it is the working directory

docker build -f $WORKSPACE/BuildImage/docker/Dockerfile .

Be sure to include the period(.) in the command.