I have a Dockerfile inside which I call a python code that generates and creates an XML report. When I build the Dockerfile, the python code runs but the problem is that I am not able to persist the the generated XML report. The Dockerfile is as below:
FROM python:3.7.5-alpine3.10 as base
FROM base as builder
RUN mkdir /install
WORKDIR /install
pip install flask
COPY *.py /app/
WORKDIR /app
RUN python main.py
main.py
has a code to generate an XML report.
When I just call python main.py on cmd prompt, the report gets generated and saved on the same directory where the code is . But I am not able to locate the report when I call build Docker (which in turns calls RUN main.py). The way I build docker is as follows:
docker build -f ./Dockerfile
Only on the success based on the report output, I decide whether to get create the docker image or not.