Closed profnandaa closed 2 days ago
While we're here, ~I was torn between adding this case to NormalizePath
or reverting to how it was initially at func dispatchCopy
~.
Also wanted to understand the intention for this block: @gabriel-samfira
We need regression integration test for this as well. Is this something that should be handled by
pathRelativeToWorkingDir
(that part could be follow up).
Sure, it's better at pathRelativeToWorkingDir
, I've moved it and also fixed how "" dir's were being handled.
Added the integration tests. It was very interesting that the tests were passing even without the fix, if you have /
as the WORKDIR; and was getting a little thrown off. However, fixed with: WORKDIR /var/www
and could repro the regression correctly.
@tonistiigi - PTAL again.
In my previous fix on #4825, I had removed this line knowing that all that had been addressed in
pahtRelativeToWorkingDir
:However, I had overlooked the
"."
and""
scenarios.""
. The"/"
case is handled correctly insystem.NormalizePath()
.This change therefore undoes this, to make sure "." is transformed correctly to "./" during COPY operation, same to "" -> "./". This is important especially for WORKDIR that are not
/
, so thatCOPY --link
operations are handled properly.fixes #5070