I am having a docker application. The build and image build gets successful when I build the image from local machine. But when I moved my code to azure devops, its failing. First I have just moved the code and build the code with Hosted VS2017 agent provided by Azure DevOps. The build was successfully. I have used custom build agent also, and the build was successful. Later I have added docker task to build pipeline to build the image. The image build getting failed with below error.
[command]"C:\Program Files\Docker\docker.exe" build -f D:\a\1\s\WebApplication1\Dockerfile --label com.azure.dev.image.system.teamfoundationcollectionuri=https://dev.azure.com/rajakondla/ --label com.azure.dev.image.system.teamproject=MyProject --label com.azure.dev.image.build.repository.name=MyProject --label com.azure.dev.image.build.repository.uri=https://rajakondla@dev.azure.com/rajakondla/MyProject/_git/MyProject --label com.azure.dev.image.build.sourcebranchname=master --label com.azure.dev.image.build.sourceversion=51666d2f6f03878358e22acd7c68787eeba7b2e9 --label com.azure.dev.image.build.definitionname=MyFirstBuild --label com.azure.dev.image.build.buildnumber=20190418.1 --label com.azure.dev.image.build.builduri=vstfs:///Build/Build/24 --label "com.azure.dev.image.build.requestedfor=Raja Kondla" source=obj\docker\publish -t myfirstproject:24 D:\a\1\s\WebApplication1
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
[error]C:\Program Files\Docker\docker.exe failed with return code: 1
I have enter below options in that build docker step.
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: mydockerconnection
dockerFile: WebApplication1/Dockerfile
arguments: 'source=obj\docker\publish'
imageName: 'myfirstproject:$(Build.BuildId)'
includeLatestTag: true
useDefaultContext: false
buildContext: WebApplication1
docker build
step? – 4c74356b41source
argument in thedocker build
arguments. docs.docker.com/v17.09/engine/reference/commandline/build. also, arguments are supposed to be prepended with--
– 4c74356b41