如何在jenkins中构建一个docker镜像(How to build a docker image within jenkins)

编程入门 行业动态 更新时间:2024-10-11 15:25:12
如何在jenkins中构建一个docker镜像(How to build a docker image within jenkins)

我有一个jenkins maven工作,并试图建立一个码头图像。 当我使用此命令构建映像时:

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

我收到此错误:

docker:“build”需要1个参数。 请参阅'docker build --help'

我已经重新检查并检查了这个命令几十次。 我甚至试过直接在终端上运行它。 它适用于终端,但不适用于詹金斯。 有什么我想念的吗?

我使用的是Docker 1.12.6版

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

最满意答案

通常是

docker build -t foo/bar .

^行末尾的点(。)指定用作Docker上下文的当前路径。 试试cd到docker文件夹?

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?

更多推荐

本文发布于:2023-08-07 00:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1459092.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:镜像   构建一个   如何在   jenkins   docker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!