Closed sudomateo closed 2 years ago
I requested a quick spot check from the original poster to validate the fix on their end. I'll give them a little time to respond before merging. Thanks again for the fix.
I requested a quick spot check from the original poster to validate the fix on their end. I'll give them a little time to respond before merging. Thanks again for the fix.
Sounds good to me! Thank you for the review!
When running multiple
docker-push
post processors concurrently, there was a race condition where onedocker-push
post processor would finish and calldocker logout
to remove the credentials for a given registry while anotherdocker-push
post processor was still running, causing the otherdocker-push
post processor to no longer have access to the registry credentials to perform adocker push
.Since the underlying
DockerDriver
shells out to rawdocker
commands, calls toLogin
store registry credentials in the default Docker client configuration directory. Additionally, calls toLogout
remove registry credentials from the default Docker client configuration directory. Since Packer post processors are unaware of each other, onedocker-push
post processor was removing registry credentials that anotherdocker-push
post processor relied on.These changes modify the
docker-push
post processor to use a temporary, isolated Docker client configuration directory. This allows eachdocker-push
post processor to store registry credentials in an isolated file that will not be accessed by anotherdocker-push
post processor.The implementation not modify the
Driver
interface, choosing instead to add an exported field to theDockerDriver
type that thedocker-push
sets.Closes #81