本文介绍了用jenkins在kubernetes实例上使用docker-compose - 安装空卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Google的Jenkins实例设置:
$ b

所以看起来好像不可能挂载从外部码头到内部码头的东西。另一个解决方案必须找到。


I have a Jenkins instance setup using Googles Jenkins on Kubernetes solution. I have not changed any of the settings of the Kubernetes Pod.

When I trigger a new job I am successfully able to get everything up and running until the point of my tests.

My tests use docker-compose. First I make sure to install docker (1.5-1+b1) and docker-compose (1.8.0-2) on the instance (I know I can optimize this by using an image that already includes these, but I am still just in proof-of-concept).

When I run the docker-compose up command everything works and the services start their initialization scripts. However, the mounts are empty. I have verified that the files exist on the Jenkins slave, and the mount is created inside the docker service when I run docker-compose, however they are empty.

Some information:

In order to get around file permissions I am using /tmp as the Jenkins Workspace. I am using SCM to pull my files (successfully) and in the docker-compose file I specify version: '2' and the mount paths with absolute paths. The volume section of the service that fails looks like this:

volumes:
 - /tmp/automation:/opt/automation

I changed the command that is run in the service to ls /opt/automation and the result is an empty directory.

What am I missing? I just want to mount a directory into my docker-compose service. This works perfectly from Windows, Ubuntu, and Centos devices. Why won't it work using the Kubernetes instance?

解决方案

I found the reason it fails here:

So it seems like it will be impossible to mount something from the outer docker into the inner docker. And another solution must be found.

这篇关于用jenkins在kubernetes实例上使用docker-compose - 安装空卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 10:20