Concourse: How to execute commands in docker as part of build step

Created on 5 Jun 2017  路  2Comments  路  Source: concourse/concourse

Feature Request

What challenge are you facing?

I have some web services written in golang which use makefile build template from thockin. This is useful for developers since everyone gets consistent builds without relying on system go version. However, when I try to execute it within concourse, I am getting following error:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

After reading up on available options, I realised that a privileged task with amidos/dcind works for us. The most annoying downside of this arrangement is not sharing the cache with docker daemon running on host. Since some of our docker images are multi-gigabyte, this hurts a lot.

A Modest Proposal

After reading "Using Docker-in-Docker for your CI or testing environment?", I realised that just sharing the docker.sock with running container is sufficient.

Can this already be done within concourse? If not, can we please add a flag akin to privileged to use parent docker daemon?

efficiency question stacdocker

Most helpful comment

Actually I have similar issue. My build is defined in gradle. In one step binaries, Docker image are built. It helps to fail a build fast in case of any error. I've tried to model it in concourse and failed because of lack of docker client tools connected to a docker daemon. If concourse would provide a docker client tools, it would solve the issue.

All 2 comments

@surajbarkale-dolby there is no docker daemon running in the majority of concourse installations. There would be no such docker.sock to share with the running container.

It sounds like you are largely complaining about efficiency, but I'd point you at #324

Actually I have similar issue. My build is defined in gradle. In one step binaries, Docker image are built. It helps to fail a build fast in case of any error. I've tried to model it in concourse and failed because of lack of docker client tools connected to a docker daemon. If concourse would provide a docker client tools, it would solve the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manali14 picture manali14  路  3Comments

topherbullock picture topherbullock  路  3Comments

AustinBGibbons picture AustinBGibbons  路  3Comments

clarafu picture clarafu  路  3Comments

Lindsayauchin picture Lindsayauchin  路  3Comments