Good afternoon
I'm a new user of Docker and I have a question please:
I created a container named "container_worker" which running a Python script to create some data. The data created is stored in the container in a file named "data".
I want to copy this "data" file to my host to be able to use it for another purpose. I saw it's possible to do it with the "docker cp" command but I want to do it directly in my Dockerfile or my Docker-compose file.
Here are my files:
Dockerfile:
FROM archlinux
RUN pacman-db-upgrade \
&& pacman -Syyu --noconfirm \
&& pacman -S python --noconfirm \
&& pacman -S python-pip --noconfirm \
&& pip install requests
COPY /worker/script.py .
CMD python3 vmtracer.py >> data
docker-compose.yml
version: "3"
services:
worker:
image: image_worker
container_name: container_worker
build:
dockerfile: ./worker/Dockerfile
Thank you very much.