Please note that only issues related to this Docker image will be addressed here.
If after going through the previous checklist you still think you should create an issue here please provide:
docker run \
-u root \
--name jenkins_lts \
-d \
-p 8080:8080 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins:lts-slim
/var/jenkins_home/workspace/trial_master@tmp/durable-dd76dfd6/script.sh: 1: /var/jenkins_home/workspace/trial_master@tmp/durable-dd76dfd6/script.sh: docker: not found
Correct implementation
No
docker versionDocker version 19.03.8
Use Blue Ocean
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
pipeline {
agent {
docker {
image 'node:lts-buster-slim'
args '-p 8989:8989'
}
}
environment {
NODE_ENV = 'production'
}
stages {
stage('Install') {
steps {
echo 'Installing..'
sh 'yarn'
echo 'Install Success'
}
}
stage('Build') {
steps {
echo 'Building..'
sh 'yarn build'
echo 'Build Success'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
echo 'Deploying..'
input message: 'Finished using the web site? (Click "Proceed" to continue)'
sh './jenkins/deploy.sh'
echo 'Deploy Success'
}
}
}
}
I don't think the docker images have docker inside of them. This is not something that we really want to do at this point I think. You can setup docker based agents though.
@slide I have solved the problem, but I think Jenkins docs should supplement the corresponding warnings or prompts, as well as the corresponding solutions, so that users can run successfully according to the configuration of docs, and avoid confusion.
I'm not sure I understand what you mean, what docs are you following that the behavior doesn't match?
I see Jenkins manual here jenkins doc
@jiankafei how you solve the problem?
@undead85
You can read this article. Running Docker in Jenkins (in Docker)
@jiankafei I set up my jenkins to be able to run docker commands and in the example on this link the 'docker run hello-world' works pretty fine as well as another projecsts/pipeleine but in this one when I finished build my docker image and try to pull to my registry I got 'docker not found':
docker build -t tadeuuuuu/infra-developer:22 .
/var/jenkins_home/workspace/infra-dev@tmp/durable-7abc7028/script.sh: 1: /var/jenkins_home/workspace/infra-dev@tmp/durable-7abc7028/script.sh: docker: not found
Ideas? Any light will be appreciate!
Most helpful comment
@jiankafei how you solve the problem?