fix paracel docker builds using same docker tag issue #379
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 imageBelow is the steps to re produce the above error:
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.