简体   繁体   English

Jenkins 不带 Docker 吗?

[英]Jenkins does not come with Docker?

I'm starting to learn Jenkins and I'm following the guide on their website.我开始学习 Jenkins,我正在按照他们网站上的指南进行操作。 This is a new Jenkins install, installed all the recommended plugins.这是一个新的 Jenkins 安装,安装了所有推荐的插件。 I've created a valid Jenkinsfile, initialized git in the project folder, and I'm trying to build, however, Jenkins doesn't seem to find Docker. When building, I get:我创建了一个有效的 Jenkinsfile,在项目文件夹中初始化了 git,我正在尝试构建,但是,Jenkins 似乎找不到 Docker。构建时,我得到:

/Users/me/.jenkins/workspace/Test_pipeline_master@tmp/durable-ba04c9ec/script.sh: line 1: docker: command not found

Am I supposed to install a separate docker installation?我应该安装一个单独的 docker 安装吗? I'm checking and I do have Docker plugin:我正在检查,我确实有 Docker 插件:

在此处输入图像描述

My Jenkinsfile has:我的 Jenkinsfile 有:

pipeline {
    agent { docker { image 'node:7-alpine' } } #also tried with python:3.7 to no avail
...

What am I missing?我错过了什么?

Yes, you need to install docker if you are planning to use docker. Once installed, you also need to add the user 'jenkins' to docker group.是的,如果您打算使用 docker,则需要安装 docker。安装后,您还需要将用户“jenkins”添加到 docker 组。 See these two links for more help.请参阅这两个链接以获得更多帮助。 (if you are installing jenkins on other OS, search for appropriate help for installing docker for that OS) (如果您在其他操作系统上安装 jenkins,请搜索为该操作系统安装 docker 的适当帮助)

https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04 https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04

https://www.edureka.co/community/7764/trying-docker-jenkins-pipeline-facing-jenkins-pipeline-socket https://www.edureka.co/community/7764/trying-docker-jenkins-pipeline-facing-jenkins-pipeline-socket

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

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