fix content-type detection in docker cp

Fix #4697