-1
I have a code that should be run in a container. As soon as it runs it will generate a png file. Follow Dockerfile:
FROM python:3
COPY . /projeto
RUN apt update
RUN yes | apt install libeccodes-tools
RUN yes | apt install -y python3 && yes | apt install python3-pip
RUN pip3 install -r projeto/requirements.txt
WORKDIR /projeto
CMD python3 exemplo.py
example.py:
import pandas as pd
ex = pd.DataFrame({'teste': [1,2,3,4,5,6]})
ex.to_csv('exemplo.csv')
Image build:
docker build -t meu_codigo .
I wish I could give the command below and in the scheduled execution process already save the png images(or any file I generate) in some host computer folder.
docker run --rm meu_codigo
How can I do that? Thanks in advance.
Why not create a volume and use with the container? so all that save on volume will already be available on the host computer without needing commands to copy
– Ricardo Pontual
This image will need to be rotated daily and restarted at the end of the process. These are the guidelines that the team below.
– Rodrigo Junior
right, but you don’t need to delete the right volume? It’s that "folder" you want to save. If you just want to do a job that moves the volume content to another place
– Ricardo Pontual