Docker cp requires two arguments
It would seem on some versions of Docker, docker cp
does not support parameter expansion...
For example
WORKS Docker version 19.03.4-ce, build 9013bf583a
CTR_ID=$(docker ps -q -f name=containername)docker cp patches $CTR_ID:/home/build
FAILS Docker version 19.03.4-ce, build 9013bf583a
BUILDHOME=/home/builddocker cp patches containeridliteral:$BUILDHOME
In your case, maybe the pwd
is not expanding properly.