0

I'm following this documentation to push signed images to ACR from Azure pipelines. However, this only describes the changes needed in yaml tasks. I'm using a classic release pipeline, and I'm facing some issues. I'm trying to push the image using an Azure CLI script. Before the script task, I'm using the Secure files in pipeline to download the private key file and used the below CLI script -

echo '---------Create Private Delegate Key for signing--------'
mkdir -p ./docker/trust/private
echo 'Created Trust Directory'
echo 'Copying $(privateKey.secureFilePath) to ./docker/trust/private'
cp $(privateKey.secureFilePath) ./docker/trust/private

I'm getting the below error on running

echo $(SigningPassphrase) | docker push --disable-content-trust=false $(registry)/$REPOSITORY_NAME:$BUILD_TAG

Error: no valid signing keys for delegation roles

I added the following lines in the script to load the private key -

chmod 600 ./docker/trust/private/$(KeyFileName)
echo '-----Loading Key-----'
docker trust key load ./docker/trust/private/$(KeyFileName)

But signing of the image is still failing after loading the key. I also tried changing the key file name to the repository key.

Error on image signing

Am I placing the file in an incorrect location? It's being placed in /home/vsts/.docker/trust/private. What should be the location to place the private key file in, so that docker can recognize it to sign the images?

Kruti Joshi
  • 384
  • 3
  • 16

0 Answers0