Docker Community Forums

Share and learn in the Docker community.

Cant get artifacts from pytest Dockerfile - please help

Directory

docker_folder
 | requirements.txt
 | src
    | -> __init__.py
    | -> cat.py
    | -> animal.py
 | tests
    | -> __init__.py
    | -> test_animal.py
    | -> test_cat.py
Dockerfile

Dockerfile

FROM python:3.7
COPY ./docker_folder/ .
RUN pip install -r requirements.txt
CMD pytest -v --tb=line --junitxml=tests/reports/results.xml --resultlog=tests/reports/testlog.log tests/

$ docker volume ls

DRIVER              VOLUME NAME
local               testVolume

$ docker volume inspect testVolume

[
  {
      "CreatedAt": "2019-07-24T16:33:44Z",
      "Driver": "local",
      "Labels": {},
      "Mountpoint": "/var/lib/docker/volumes/testVolume/_data",
      "Name": "testVolume",
      "Options": {},
      "Scope": "local"
  }
]

$ docker build -t damnyou .
runs successfully

Successfully built 23a3d34a46e7
Successfully tagged damnyou:latest

$ docker images

REPOSITORY                                          TAG                 IMAGE ID            CREATED              SIZE
damnyou                                             latest              23a3d34a46e7        About a minute ago   940MB

$ docker run -v /Users/rm026/Desktop/TestVolume:/var/lib/docker/volumes/testVolume/_data damnyou
All my tests execute successfully and get the prompt that my xml file has been generated + log file as well

However, it seems I cannot access any of the artifacts! What am I doing wrong???