Closed medwards closed 4 years ago
When run in the test suite the container will recompile the project even though it doesn't have to (I haven't figured out why, when I docker run by hand in the test folder it works as expected (finishes compilation in less than a second because its already done).
Oh this is nasty, the old behaviour (tests not doing a full recompile on the second release build) is actually a bug due to the target folder being owned by root. It's supposed to clean up the target folder before every build but since the tests didn't have permissions the old target folder remained.
Thanks for spotting this. I'll take a closer look soon
The docker container runs as
root
so mountingregistry
andgit
in the container results in pollution of a users.cargo
folder withroot
-owned artifacts. Trying to do things likecargo update
will then break.Instead run the container as a normal user.
Requires pulling the cargo install out of
/root
. Also theyum install
step won't work when running as a normal user. When run in the test suite the container will recompile the project even though it doesn't have to (I haven't figured out why, when Idocker run
by hand in the test folder it works as expected (finishes compilation in less than a second because its already done).Note: this will still write ~/.cargo/registry and ~/.cargo/git as owned by root if they don't exist when the container runs. May be due to -v mounts ignoring -u when the mountpoint doesn't exist.