Summary: automated builds in my Docker repos started to fail complaining that “Your local changes […] would be overwritten by checkout” when the build process clones my repo in order to build it
Details: I have several repositories for which automated builds in Docker Cloud were working fine. I then started changing the configuration to build from different branches and I can’t figure out why I started getting the error stated in the Summary above. Why would the build environment have any local changes in the first place? Is it not executing git clone on an empty folder?
This is the resulting build log (information specific to my git repo edited out):
Building in Docker Cloud's infrastructure...
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '###.###.###.###' to the list of known hosts.
error: Your local changes to the following files would be overwritten by checkout:
Please, commit your changes or stash them before you can switch branches.
please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)
ERROR: Build failed: please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)
ERROR: Build failed with exit code 2
ERROR: Build in '<branch-name>:<build-context-directory>:<path-to-Dockerfile>' (2320b4c0) failed in 0:01:01
I’m not even sure there’s anything I can try to do about it with hooks, since the first one available is
checkout is what seems to be failing…