我有一个Jenkins作为docker容器运行,现在我想使用管道构建一个Docker镜像,但Jenkins容器总是告诉Docker找不到.
[simple-tdd-pipeline] Running shell script
+ docker build -t simple-tdd .
/var/jenkins_home/workspace/simple-tdd-pipeline@tmp/durable-
ebc35179/script.sh: 2: /var/jenkins_home/workspace/simple-tdd-
pipeline@tmp/durable-ebc35179/script.sh: docker: not found
以下是我运行Jenkins图像的方法:
docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v 
/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock 
jenkins
而Jenkins图像的DockerFile是:https: //github.com/jenkinsci/docker/blob/9f29488b77c2005bbbc5c936d47e697689f8ef6e/Dockerfile
在我的 Dockerfile 中使用时出现错误COPY --from=reference。我创建了一个最小的例子:
FROM alpine AS build
FROM scratch
COPY --from=build / /
这会导致以下构建输出:
$ docker build .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM alpine AS build
 ---> b7b28af77ffe
Step 2/3 : FROM scratch
 ---> 
Step 3/3 : COPY --from=build / /
failed to copy files: failed to copy directory: Error processing tar file(exit status 1): Container ID 165578 cannot be mapped to a host ID
构建在 CI 中运行良好,但在运行 Ubuntu 18:04 的笔记本电脑上失败。什么可能导致此问题?
Typically, if I have a remote server, I could access it using ssh, and VS Code gives a beautiful extension for editing and debugging codes for the remote server. But when I create pods in Kuberneters, I can't really ssh into the container and so I cannot edit the code inside the pod or machine. And the kuberneters plugin in VSCode does not really help because the plugin is used to deploy the code. So, I was wondering whether there …