Can't find Dockerfile in Azure Devops Pipelines (example from Microsoft azure) - azure

I am following the example from the microsoft website:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/containers/build-image?view=azure-devops
But I get the following issue
Starting: Build an image
==============================================================================
Task : Docker
Description : Build or push Docker images, login or logout, start or stop containers, or run a Docker command
Version : 2.192.0
Author : Microsoft Corporation
Help : https://aka.ms/azpipes-docker-tsg
==============================================================================
##[error]Unhandled: No Dockerfile matching /home/vsts/work/1/s/app/Dockerfile was found
Why is it trying to find the file in a '/home/vsts/work/1/s/' directory when the parameter states 'app/Dockerfile'?

The build task is trying to find your Dockerfile at the agent build directory under app/Dockerfile.
You will need to check make sure your devops pipeline is properly connected to the repo you are referencing, and is structured accordingly.

Related

Azure DevOps : Create Immutable image deployment failed to find the script file

I'm looking to build Release pipeline to create a immutable ubuntu machine for my VMss.
I have deployment.sh with all required application for Vmss.
I'm trying to build Image for a Jar based application.
I have my artifacts structure as per below
I'm trying to build immutable image using build image task from azure DevOps
as given below.
On running task i'm getting a error with the following log.
2021-07-22T10:34:13.5841600Z ==> azure-arm: chmod: cannot access '/deployTemp/app.jar/../../deployment.sh': Not a directory
2021-07-22T10:34:13.5842952Z
2021-07-22T10:34:13.5862730Z ==> azure-arm: /tmp/script_5507.sh: 5: /tmp/script_5507.sh: /deployTemp/app.jar/../../deployment.sh: not found
Any Help ?
Thanks in Advance.

Azure CD pipeline can't find build artifacts

Below is Azure error log from the Azure release pipeline.
2020-07-24T05:17:13.7712974Z ##[section]Starting: Deploy Azure App Service
2020-07-24T05:17:14.0464143Z ==============================================================================
2020-07-24T05:17:14.0465719Z Task : Azure App Service deploy
2020-07-24T05:17:14.0469391Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2020-07-24T05:17:14.0469849Z Version : 3.163.5
2020-07-24T05:17:14.0470410Z Author : Microsoft Corporation
2020-07-24T05:17:14.0470921Z Help : https://aka.ms/azureappservicetroubleshooting
2020-07-24T05:17:14.0471274Z =============================================================================
2020-07-24T05:17:16.0650643Z Got connection details for Azure App Service:'XXXXX'
2020-07-24T05:17:17.6576087Z (node:764) Warning: Use Cipheriv for counter mode of aes-256-ctr
**2020-07-24T05:17:17.6627737Z ##[error]Error: No package found with specified pattern: D:\a\r1\a\Drop<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.**
2020-07-24T05:17:22.9168975Z Successfully added release annotation to the Application Insight : XXXXX
2020-07-24T05:17:24.8686063Z Successfully updated deployment History at https://XXXXX.scm.azurewebsites.net/api/deployments/231595567842919
2020-07-24T05:17:24.8933576Z ##[section]Finishing: Deploy Azure App Service
P.S. I have checked build pipeline, I can download build Artificats, but it displays below warning.
[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
Assuming you meant you have solved the build artifact empty issue, but the release pipeline still had issue in Azure App Service deploy task.
As the error mentioned, there is "No package found with specified pattern: D:\a\r1\a\Drop", you need to check how you define the package, try format $(System.DefaultWorkingDirectory)/**/*.zip instead of $(System.DefaultWorkingDirectory)\Drop.
As task "Publish Build Artifact" publish artifact from $(build.artifactstagingdirectory), so we need add a task "Copy files" to copy your files ** from $(system.defaultworkingdirectory) to $(build.artifactstagingdirectory) **. which copied my build to stagingdirectory.

Could not build Docker image WindowsServerCodre on Azure DevOps

I'm trying to build some Windows docker images on Azure Devops. However, during the last step I get:
re-exec error: exit status 1: output: time="2018-10-29T14:26:32Z" level=error msg="hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\\?\C:\ProgramData\docker\windowsfilter\e5d6a8d03464d02106a603b183b1ea47ad9fdd910a7dc1fdf19f605ec343b9cb flavour=1 folder=C:\ProgramData\docker\tmp\hcs934975059"
2018-10-29T14:26:34.2133323Z hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\?\C:\ProgramData\docker\windowsfilter\e5d6a8d03464d02106a603b183b1ea47ad9fdd910a7dc1fdf19f605ec343b9cb flavour=1 folder=C:\ProgramData\docker\tmp\hcs934975059
The weird thing is that I have the exactly same branch on my personal account and it works! It only fails for conan-io organization!
What I could do to fix it?
It's possible to check all windowsservercore here. I can't use 1709 or 1803 because of my environment.
Logs are available here:
[success] https://dev.azure.com/uilianr/conan-devops/_build/results?buildId=92&view=logs
[failing] https://dev.azure.com/conanio/conan-docker-tools/_build/results?buildId=28&view=logs
Docker recipes are here (same file on both repositories):
[uilianries] https://github.com/uilianries/conan-docker-tools/blob/feature/docker-windows/msvc_14/Dockerfile
[conan-io] https://github.com/conan-io/conan-docker-tools/blob/feature/docker-windows/msvc_14/Dockerfile

VSTS - Build a Docker Image

I have a .NET Core repo in VSTS. I'm trying to create a Build pipeline that builds a Docker image and adds it to my Azure Container Registry. My Build pipeline has a Docker task. This task has the "Build an image" action selected. This action relies on my Dockerfile, which looks like this:
FROM microsoft/dotnet:2.1.2-runtime-nanoserver-1803
# Install .NET Core
ENV DOTNET_VERSION 2.1.2
When my Build pipeline runs, I get an error that says:
failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage \\?\C:\ProgramData\docker\windowsfilter\82aba535faccd8bf0e5ce3c122247672fa671214000a12c5481972212c5e2ca0\UtilityVM: The system cannot find the path specified.
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
Why am I getting this error? How do I fix it?
It should be the same issue with this one : https://github.com/Microsoft/vsts-tasks/issues/6510
Seems it still have some issues with nanoserver-1803
Just try to setup and host a custom agent on Azure VM, then check it again.
https://github.com/Microsoft/vsts-tasks/issues/6510#issuecomment-370152300
I found maybe an explication about this error: VSTS agents seem not
support nanoserver-1709 actually. Maybe this will change with the next
version 1803.
See details here: Microsoft/vsts-agent#1393
When I setup and host a custom agent on a machine on Azure, it's
working. So it's not a bug with this task. I close this issue. Thanks!

##[error]System error 1326 has occurred. - VSTS Release Task: Windows Machine File Copy

I am using VSTS to deploy an MVC Website and a database to an Azure Virtual Machine . While trying to copy the needed dacpac file i get this error: ##[error]System error 1326 has occurred.
Here is the log from the release:
2017-11-03T10:29:50.7943998Z ##[section]Starting: Copy files from *******
2017-11-03T10:29:50.8436980Z ==============================================================================
2017-11-03T10:29:50.8436980Z Task : Windows Machine File Copy
2017-11-03T10:29:50.8436980Z Description : Copy files to remote machine(s)
2017-11-03T10:29:50.8436980Z Version : 2.0.1
2017-11-03T10:29:50.8436980Z Author : Microsoft Corporation
2017-11-03T10:29:50.8436980Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=627415)
2017-11-03T10:29:50.8436980Z ==============================================================================
2017-11-03T10:29:54.1838780Z Copy started for - *******
2017-11-03T10:29:54.9182580Z ##[error]System error 1326 has occurred.
2017-11-03T10:29:54.9807578Z ##[section]Finishing: Copy files from *******
The error does not give me alot of details about the problem so i started digging deeper in the problem. I have Enabled all the needed ports, checked if the account specified was an administrator(it was), made sure the date was set correctrly(tried this because there are some examples where it works).
Azure File Copy does not help me in my situation.
Any information would be very appreciated. Thank you !!!
I found the solution for my situation, i hope this helps someone.
Answer:
At first, in my release definition, i was running the Windows Machine Copy task on a deployment group phase. This was the problem. After a while i made another phase that runs on the Agent, this turned out to be the fix. It works with HOSTEDVS2017 Agent, and on a private Agent aswell.
Good luck !!!
I had the same problem also. I solved it by changing the version of the script from 2* to 1*. I think the problem has to do with the password
look these links
enter link description here
enter link description here

Resources