简体   繁体   中英

Error running docker build on jenkins slave

I have a jenkins master and able to pull in my code from CodeCommit. I have also set up a jenkins slave and this project has a Dockerfile that builds an image. When I try to execute the shell command,

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

I get the following error:

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM