Let's I have a Dockerfile
FROM python:3
ADD script.py /
CMD [ "python", "script.py" ]
script.py endlessly prints some logs into output.
I would like to run a container built from this Dockerfile that will prin logs into output, and remove script.py in this container AUTOMATICALLY.
For example I can change a Dockerfile or I can change the options of 'docker run' command
I tried something like:
docker run -it my_image /bin/bash -c "python /script.py; rm /script.py"
But I was not succeed. Also I tried to move two instructions into CMD, but it was not succeed as well