Docker Build and Push Command has flaky output (sometimes)
See original GitHub issueRequired Information
Bug
Type: Build fails. It shouldn’t
Enter Task Name: Docker v2.170.2
Environment
- Server: dev.azure.com
- Agent - Self hosted vsts container running in azure aks
- Image: microsoft/vsts-agent:ubuntu-16.04-docker-18.06.1-ce-standard
Issue Description
We recently began receiving a rather meaningless error from a docker - build and push task. Somewhere in the dockerfile, around step 4 or 5, it starts doing node stuff, yarn install, yarn build etc. Theres no evidence in that output that the docker build process even began.
Task logs
Starting: Build and Push Bullclip Web
==============================================================================
Task : Docker
Description : Build or push Docker images, login or logout, or run a Docker command
Version : 2.170.2
Author : Microsoft Corporation
Help : https://aka.ms/azpipes-docker-tsg
==============================================================================
##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/vsts/agent/_work/2/s/node_modules/@babel/plugin-proposal-async-generator-functions/node_modules/@babel/plugin-syntax-async-generators/node_modules/@babel/core/node_modules/.bin/json5'
Finishing: Build and Push Bullclip Web
I was able to build other pipelines with docker files (that nothing had nothing to do with node) at the time. I finally logged into the vsts container and ran docker prune
(we still had 14gb of free space). After that the build began to work… I can’t really confirm that that was the fix for it as I wasn’t out of space.
Whatever the underlying problem was the output I got from the task was really baffling (still is) and is not actionable. If the error occurred in the docker build process i should see docker build output. If the docker environment was broken i should see an appropriate message. Instead I got a ENOENT seemingly in relation to some node operation.
There isn’t even the /usr/local/bin/docker build -f /vsts/agent/_work/3/s/Dockerfile ...
line.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Thanks @worldspawn for sharing the logs. The issue is very puzzling. We are trying to provide a fix. In the meantime, you can avoid this by using direct path for Dockerfile like ./Dockerfile to unblock yourself. Please let us know if the workaround works for you.
Probably should have included the yaml:
@sonayak I added the Dockerfile element to the task and the build worked. I then removed and the problem resurfaced 👍 You’re on to something 😃