microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[Question]: docker@2 docker history --format flag throws exit code 125 #20243

Open sergeykrulikovskiy opened 1 month ago

sergeykrulikovskiy commented 1 month ago

Task name

Docker@2

Task version

2.243.0

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

CentOS Linux release 7.9.2009

Question

Hello, Everything was fine until Docker@2 task was updated from 2.240.2 to v2.243.0. Now it fails because of "unknown flag" error. I can see that all images were successfully built and pushed to the registry. But the task fails with exit code 125 (see log below).

Is there a minimal version of Docker for this task? Is there a workaorund for this issue?

Error log:

/bin/docker history --format createdAt:{{.CreatedAt}}; layerSize:{{.Size}}; createdBy:{{.CreatedBy}}; layerId:{{.ID}} --no-trunc ***.azurecr.io/demo-ui:latest
unknown flag: --format
See 'docker history --help'.
##[error]unknown flag: --format
##[error]See 'docker history --help'.
##[error]Unhandled: The process '/bin/docker' failed with exit code 125
##[error]Error: The process '/bin/docker' failed with exit code 125
    at ExecState._setResult (/etc/myagent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1249:25)
    at ExecState.CheckComplete (/etc/myagent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1232:18)
    at ChildProcess.<anonymous> (/etc/myagent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1160:19)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
sergeykrulikovskiy commented 1 month ago

as a temporary workaround I've updated pipelines to use Docker@2.240.2

v-schhabra commented 1 month ago

closing this as duplicate of #20238