Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Team Service fails Task Docker Build

I'm trying to run build Docker task to create a docker image. I set up a docker host, I'm using defautl Docker Hub as registry and my whole environment is on Azure.

When I queue a build task it fails at Task Docker.

Log output:

check path : null task result: Failed

Not found docker: null

Finishing task: Docker

[error]Task Docker failed. This caused the job to fail. Look at the logs for the task for more details.

Does someone have any thought on what may be happening?

like image 846
gabriel giovanini Avatar asked Jun 03 '16 19:06

gabriel giovanini


3 Answers

After looking into this, it would seem this happens if Docker is not properly installed on the build agent for the service principal the agent is running under.

Keep in mind that:

  • The Build must be run in a private agent, as the hosted ones do not yet have Docker installed, as per a very small footnote in the bottom of the documentation.
  • The VSTS agent must be running with a principal that has the environment variables set for docker to run; the default is LocalService account, which won't have that installed. This turns out to be a problem with other stuff as well and I've found it best to have a special user principal to run the agent under, that can also log into the system.

Fixing these two issues made it work for me.

like image 158
Anže Vodovnik Avatar answered Sep 17 '22 21:09

Anže Vodovnik


I was able to switch the agent to Hosted VS2017 which has Docker support.

like image 43
QAZZY Avatar answered Sep 19 '22 21:09

QAZZY


If Linux is an option, try Hosted Linux Preview

like image 26
Radu Popovici - Oncica Avatar answered Sep 16 '22 21:09

Radu Popovici - Oncica