简体   繁体   English

如何在jenkins中构建docker映像

[英]How to build a docker image within jenkins

I have a jenkins maven job and trying to build a docker image. 我有一个詹金斯(Jenkins)专家工作,试图建立一个docker镜像。 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. 泊坞窗:“ build”需要1个参数。 See 'docker build --help' 参见'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 我正在使用Docker 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. 行尾的点(。)指定要用作Docker上下文的当前路径。 Try a cd to docker folder? 尝试使用cd到docker文件夹吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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