Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix paracel docker builds using same docker tag issue #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelwang
Copy link

Hi guys:
I have found below errors :
the first:
---> Running in 6590edb5252a failed to get digest sha256:4ad613a6dc506a0fd79bbb4a803581176292483d3d91e33a3bd1a94195f7bf33: open /home/docker/image/overlay2/imagedb/content/sha256/4ad613a6dc506a0fd79bbb4a803581176292483d3d91e33a3bd1a94195f7bf33: no such file or directory time="2022-11-30T07:26:32Z" level=fatal msg="exit status 1"

the second:
The image does not include the right binary artifact, when I use docker inspect to check the image

Below is the steps to re produce the above error:

  1. The project has different directory which will generate different binary artifact;
  2. When parallel run below command in each of these directory ,docker run --rm --volume=/var/run/docker.sock:/var/run/docker.sock \ -e PLUGIN_TAG=latest \ -e PLUGIN_REPO=${project_repo_name} \ -e DRONE_COMMIT_SHA=07f33938ab35f5d7f812de3de62b87b783707f4d \ -e PLUGIN_DOCKERFILE=${dockerfile_in_the_different_directory} \ -v $(pwd):$(pwd) \ -w $(pwd) \ --privileged \ drone-docker --dry-run

The root cause
All above the two errors are cause by the same docker tag, because we use git commit id as the docker tag, so these different images share the same docker image tag if we parallel build the project.

The solutions
I think we may expose the build.name to the user, if they need to parallel build the project, they can override the value to avoid the issue.

@michaelwang
Copy link
Author

Please take look at this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant