Igor Khromov blog

error checking context: ‘can’t stat ‘/Users/usr/.Trash”.

If you want to build a Docker image, you need to move it from the mac user’s folder, example:

cd ~
docker build \
-t selenium/node-chrome:80.0.3987 --rm \
--build-arg CHROME_VERSION=80.0.3987.149 \
--build-arg CHROME_DRIVER_VERSION=80.0.3987.106 .

will give you an error:

error checking context: 'can't stat '/Users/usr/.Trash''.

To fix this issue, simply mode Dockerfile to some directory in user’s root folder:

mkdir selenium
cd selenium
cp ../Dockerfile .

and then execute same command:

docker build \
-t selenium/node-chrome:80.0.3987 --rm \
--build-arg CHROME_VERSION=80.0.3987.149 \
--build-arg CHROME_DRIVER_VERSION=80.0.3987.106 .

Now it will work.