Pregunta

I am putting my bamboo agents into docker containers so I can config manage and roll out and all that other awesomeness, but I have hit a barrier. One of the things my bamboo agents do is build docker images for other apps. I have not been able to roll that functionality into my docker bamboo agent.

I have read the blog post talking about docker-in-docker http://blog.docker.io/2013/09/docker-can-now-run-within-docker/

But I don't want to be able to run docker images in side a docker container, I just want to build an image and upload it to the registry. I have tried implementations of supervisor in order to start the docker daemon along with my agent but this has also proven difficult.

I am running on centos6.4

Am I trying to achieve the impossible? Is there another way to tackle this that I am not seeing?

thanks in advance for any help

¿Fue útil?

Solución

You can start a container with your Docker executable and socket as volumes like so:

docker run -v /usr/bin/docker:/usr/bin/docker -v /run/docker.sock:/run/docker.sock  -i -t ubuntu /bin/bash

In that container, you can run docker images as test to see you can do any Docker command you deem fit, like building and uploading to the registry. I use this myself to run a Jenkins slave with Docker capabilities.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top