4
votes

I've got a Dockerfile that pulls from a base image of microsoft/dotnet:2.0-runtime. When I do a build locally (on windows running Linux containers) I get a Linux docker image.

however, if we run the same build process on VSTS using a 2017 Hosted agent then we get a windows docker image.

Is it possible to build a Linux docker image on VSTS 2017 Hosted agent without having to use a Linux build agent?

1
Why wouldn't you use a Linux build agent? There are Hosted Linux build agents.Brian Cristante
They're in 'preview'Kevin Smith
Looks like they will be moving out of preview in the next couple of weeks: docs.microsoft.com/en-us/vsts/release-notes/2018/…Brian Cristante
At this time, the ubuntu agent is out of preview and is able to build linux docker images.StingyJack

1 Answers

5
votes

No, there is no way to build a Linux docker image with VSTS Hosted VS2017 agent. Hosted VS2017 agent can only build for Windows docker images.

The workarounds to build Linux docker image as below:

  • Build with Hosted Linux Preview agent
  • Build with private agent with your own windows machine