question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker Build and Push Command has flaky output (sometimes)

See original GitHub issue

Required 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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sonayakcommented, Jun 10, 2020

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.

1reaction
worldspawncommented, Jun 10, 2020

Probably should have included the yaml:

parameters:
  - name: region
    type: string

jobs:
  - job: BuildPush
    displayName: Build and Push
    steps:
      - task: Docker@2
        displayName: Login to ACR
        inputs:
          command: login
          containerRegistry: drawboard${{ parameters.region }}
      - task: Docker@2
        displayName: Build and Push Bullclip Web
        inputs:
          command: buildAndPush
          repository: drawboard-teams-web
          tags: |
            $(Build.BuildNumber)

@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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker build - Docker Documentation
docker build : The `docker build` command builds Docker images from a Dockerfile and a "context". A build's context is the set of...
Read more >
Use Docker to build Docker images - GitLab Docs
When running docker build , each command in Dockerfile results in a layer. These layers are kept around as a cache and can...
Read more >
fabric8io/docker-maven-plugin
It is easy to include build artefacts and their dependencies into an image. Several ways for configuring the builds are supported: An own...
Read more >
How to Fix Flaky Tests - Semaphore CI
The problem with flaky tests. An essential property of an automated test is its determinism: if the code hasn't changed, the results shouldn't ......
Read more >
Jenkins trigger build on git commit - Veiled Mirror
Jenkins Automated CI:CD build trigger from git push to githubПодробнее. ... easily find the last code if needed because sometimes new code has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found