相关疑难解决方法(0)

使用Docker Jenkins容器管道构建docker镜像时找不到Docker

我有一个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
Run Code Online (Sandbox Code Playgroud)

以下是我运行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
Run Code Online (Sandbox Code Playgroud)

而Jenkins图像的DockerFile是:https: //github.com/jenkinsci/docker/blob/9f29488b77c2005bbbc5c936d47e697689f8ef6e/Dockerfile

jenkins docker dockerfile jenkins-pipeline

17
推荐指数
4
解决办法
2万
查看次数

在多步构建中复制时 Docker 构建失败

在我的 Dockerfile 中使用时出现错误COPY --from=reference。我创建了一个最小的例子:

FROM alpine AS build

FROM scratch
COPY --from=build / /
Run Code Online (Sandbox Code Playgroud)

这会导致以下构建输出:

$ 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
Run Code Online (Sandbox Code Playgroud)

构建在 CI 中运行良好,但在运行 Ubuntu 18:04 的笔记本电脑上失败。什么可能导致此问题?

docker

9
推荐指数
3
解决办法
5916
查看次数

有没有办法使用 VS Code 在 kubernetes pod 中编辑代码?

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 …

kubernetes visual-studio-code

8
推荐指数
4
解决办法
3883
查看次数