Docker cannot find file in image when it is there?

Pretty new to Docker but I am trying to use it to automate building of a layer for a Lambda function from Windows 10.

Currently my Dockerfile looks like this:

FROM lambci/lambda:build-python3.7
ADD . /media/output
RUN pip install dos2unix
RUN python -m dos2unix /media/output/ /root/
RUN chmod +x /root/
RUN /root/

And I have this Batch file:

docker build -t pyodbcbuild .

docker images -q pyodbcbuild > containerId.txt
set /p containerId=<containerId.txt

docker cp %containerId%:/root/ ./
REM docker rm %containerId%

When I run the batch file the container builds fine and does all of the script correctly and creates a file at /root/

However at the cp command it always fails with this:

docker cp 0e56835088ec:/root/ ./ Error: No such container:path: 0e56835088ec:/root/

When I run the container I can clearly see the file is there? enter image description here