Closed Tharnas closed 6 years ago
We don't currently have a task that can deploy an image to ECR. I've added the request to our backlog of new features to address.
In the meantime, there are a couple of options that might work for you:
You can use the Docker tasks with ECR if you install amazon-ecr-credential-helper on your agents.
Many thanks for your help.
@cameronattard: amazon-ecr-credential-helper looks interesting but I don't really like to persist my credentials on the build server.
@steveataws: I installed PowerShell 6 on linux but I cannot trigger the deployment of a release. The following error message is shown:
There are issues with the release definition that may prevent deployment of release
Issues with Environment '\
': Issues with deploy phase 'Run on agent' - No agents could be found that match the following demands (queue: '\ '): DotNetFramework Do you want to queue the release anyway?
In case I continue it breaks with the following error in the "Run on agent" step:
Deployment on this environment was cancelled.
Were you trying to run the 'AWS Tools for Windows PowerShell Script Task' by any chance? That task is for the Windows desktop version of PowerShell, and our corresponding module named AWSPowerShell, hence it has a dependency on the 'full' .NET framework.
To run in PowerShell Core on Linux, you need to get the module named AWSPowerShell.NetCore. Start PowerShell Core on Linux and run install-module AWSPowerShell.NetCore
.
Once the Linux agent is set up with the installs, you'll need to concoct some form of a shell task to run PowerShell and a script using the NetCore version of our module. I haven't recently looked at the built-in TFS PowerShell tasks to see if any of them now support running PowerShell Core on Linux. If they don't, a shell script to launch PowerShell, set up credentials and then run a script using the AWSPowerShell.NetCore cmdlets would need to be put together.
In a future release we want to circle back and add a task to run scripts using our AWSPowerShell.NetCore module, with the auto-install capability of our existing task. We've some research yet though to figure out best approaches.
Ah ok, my bad. Thanks for clarifying!
v1.0.14 is now released with a new task to push an image to an ECR registry.
HTH
Many thanks. Works like a charm!
Good to know! Resolving request.
Is there a way to deploy docker images to ECR on a Linux build server?
There is the "AWS Tools for Windows PowerShell scripts" Task but PowerShell does not work on Linux. With "AWS CLI commands" it is also not possible to login docker to AWS ECR.