" COPY plugins.txt"在Windows的Docker中的Jenkins中失败 [英] "COPY plugins.txt" in Jenkins in Docker in Windows failed
问题描述
docker pull jenkinsci/blueocean
docker network create jenkins
docker volume create jenkins-docker-certs
docker volume create jenkins-data
docker container run --name jenkins-docker --rm --detach --privileged --network jenkins --network-alias docker --env DOCKER_TLS_CERTDIR=/certs --volume jenkins-docker-certs:/certs/client --volume jenkins-data:/var/jenkins_home docker:dind
docker container run --name jenkins-blueocean --rm --detach --network jenkins --env DOCKER_HOST=tcp://docker:2376 --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 --volume jenkins-data:/var/jenkins_home --volume jenkins-docker-certs:/certs/client:ro --publish 1122:8080 --publish 50000:50000 jenkinsci/blueocean
然后,
//method 1, failed
FROM jenkinsci/blueocean:latest
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
////////////////////////////////////////////////////////////////////
Step 2/3 : COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
COPY failed: stat /var/lib/docker/tmp/docker-builder945145338/plugins.txt: no such file or directory
////////////////////////////////////////////////////////////////////
//method 2, failed
FROM jenkinsci/blueocean:latest
COPY plugins /var/jenkins_home/plugins/
//method 3, warning and plugins still not include
FROM jenkinsci/blueocean:latest
COPY . /var/jenkins_home/plugins/
////////////////////////////////////////////////////////////////////
A@pc2 MINGW64 /f/jenkins_blueocean $ docker build -t my_custom_jenkins . Sending build context to Docker daemon 2.048kB Step 1/2 : FROM jenkinsci/blueocean:latest ---> 69b6d837d67b Step 2/2 : COPY . /var/jenkins_home/ ---> b1bf0ef60bff Successfully built b1bf0ef60bff Successfully tagged my_custom_jenkins:latest SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
////////////////////////////////////////////////////////////////////
我尝试了(DockerToolbox-19.03.1.exe)中COPY cmd以上的内容Docker Quickstart Terminal& Windows PowerShell(Admin),都失败了...
错误信息如下:
I tried the above COPY cmd in (DockerToolbox-19.03.1.exe)Docker Quickstart Terminal & Windows PowerShell(Admin), both failed... the error info are sth like this:
Step 2/3 : COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
COPY failed: stat /var/lib/docker/tmp/docker-builder945145338/plugins.txt: no such file or directory
我想在Windows的Docker中安装Jenkins和所需的插件,然后保存Jenkins&所有插件都使用Docker,以便使用詹金斯和所有插件都在另一台离线PC中。
I want to install Jenkins and the needed plugins in Docker in Windows, and then save the Jenkins&all the plugins use Docker, in order to use the Jenkins&all the plugins in another Offline PC.
推荐答案
在哪里存储plugins.txt文件?
Where do you store plugins.txt file?
它应该与Dockerfile存在于同一文件夹中。
It should exist in the same folder with Dockerfile.
这篇关于" COPY plugins.txt"在Windows的Docker中的Jenkins中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!