Skip to content
Advertisement

output of docker container

I have this docker file:

JavaScript

ANd I’m using this two commands to run it:

JavaScript

How can I receive the output of my script in the text file and not in the terminal and can I automatize the process? For example to start the script everyday in the certain time?

Advertisement

Answer

Run container and write result to a file:

winpty docker run -it --rm --name my-running-app php_script >> /path/to/filename.txt

For the daily task create a cronjob cronjob -e and add line like:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement