简体   繁体   中英

How to build a docker image within jenkins

I have a jenkins maven job and trying to build a docker image. When I build the image with this command:

docker build ./docker/ -t containers.test.com/78/tools

I get this error:

docker: "build" requires 1 argument. See 'docker build --help'

I have rechecked and checked this command dozens of times. I've even tried running it directly in the terminal. It works in the terminal but not in jenkins. Is there something I am missing?

I am using Docker version 1.12.6

Normally it is

docker build -t foo/bar . 

^ the dot (.) at the end of the line designates current path to use as Docker context. Try a cd to docker folder?

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